def trailing_zeroes(num):
    """
    Counts the number of trailing 0 bits in hashed value 'num'
    """
    # print(num)
    if num == 0:
        return 32 # assuming 32bit inputs
    p = 0
    while (num >> p) & 1 == 0:
        p += 1
    return p