n = int(input()) assert 2 <= n <= 10 ** 9 for i in range(60): if n == 2 ** i: print(1) exit() if n % 2 == 0: print(3) else: print(2)