def popcount(n): cnt = 0 while n: cnt += n & 1 n //= 2 return cnt N = int(input()) if popcount(N) == 1: print(1) else: if N % 2: print(2) else: while N % 2 == 0: N //= 2 if popcount(N) == 1: print(2) else: print(3)