import sys def check_range(a,b,x): if a > x or b < x: sys.exit() def check_eq(a,b): if a != b: sys.exit() def cal(x): if x == 1: return 0 elif x == 2: return 1 elif x % 2 == 1: buf = cal(x // 2) + 2 return buf else: buf = cal(x // 2) + 1 return buf N = int(input()) check_range(1,100000000,N) print(cal(N))