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