n = int(input()) s = list(bin(n)) while s[-1] == "0": s.pop() if ''.join(s) == "0b1": print("1") elif n % 2 == 1: print("2") else: print("3")