import strutils, math let N = stdin.readLine.parseInt for i in 3 .. N: if i ^ 2 > N: if N mod 2 == 0: echo N div 2 else: echo N elif N mod i == 0: echo i else: continue break