using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class P { static void Main() { int A = int.Parse(Console.ReadLine()); A -= 100; while(true) { if(Calc(A)) { Console.WriteLine(A); break; } A++; } } static bool Calc(int N) { int i = 1; if (N==1||N==0) { return false; } while(true) { i++; if(N%i==0) { return true; } if(N==i) { return false; } } } }