n = int(input()) res = 0 nn = n while nn > 1: if nn % 2 == 1: nn += 1 else: nn //= 2 res += 1 print(res)