def f(k):b=bin(k)[::-1];return len(b)-2-(b.count('1')==2),b.find('1')

for test in (15, 16, 40, 264, 17179867136):
	print(test, ' --> ', f(test))