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