def longest_consecutive_zeroes(n):
max_count = 0
current_count = 0
while n > 0:
if (n & 1) == 0: # Check if the least significant bit is 0
current_count += 1
max_count = max(max_count, current_count) # Update max_count
else:
current_count = 0 # Reset count when a 1 is encountered
n >>= 1 # Right shift the number
return max_count
num = 11298 # Binary: 0010110000100010
print("Longest consecutive zeroes:", longest_consecutive_zeroes(num))
'''
run:
Longest consecutive zeroes: 4
'''