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