import strutils let n = stdin.readLine.parseInt for i in (n - 100) .. (n + 100): for j in 2 .. i: if (i mod j == 0) and (i div j != 1): echo i quit()