#!/usr/bin/env python3 from collections import deque dpos4 = ((1, 0), (0, 1), (-1, 0), (0, -1)) dpos8 = ((0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1)) mod1 = 10**9 + 7 mod2 = 998244353 inf = 1 << 60 def main(): N = int(input()) ans = 0 while N > 1: ans += 1 if N % 2 == 0: while N % 2 == 0: N //= 2 else: N += 1 print(ans) if __name__ == "__main__": main()