n = int(input()) if n%2: print(2) else: if n&(n-1): print(3) else: print(1)