N = int(input()) count = 0 pw = 1 while pw != N: pw = pw * 2 if pw >= N: break count += 1 rest = N - pw / 2 if rest == 0: print(count) elif rest == 1: print(count + 1) elif rest%2 == 0: print(count + 1) else: print(count + 2)