n = int(input()) if n == 1: print(0) else: k = 0 while n % 2 == 0: k += 1 n = n // 2 if n == 1: print(1) else: print(2 if k == 0 else 3)