C = int(input()) for i in range(2,C): if C % i == 0: ans = i break print(ans)