n = int(input()) if bin(2).count('1') == 1: print(1) elif n % 2 == 1: print(2) else: print(3)