import java.util.*;
class nextprime
{
int num;
Scanner sc=new Scanner(System.in);
public nextprime()
{
System.out.println("enter number");
num=sc.nextInt();
}
public nextprime(nextprime ref)
{
int j,temp;
for(;true;)//while(true)
{
temp=ref.num+1;
for(j=2;j<=temp;j++)
{
if(temp%j==0)
break;
}
ref.num=temp;
if(j!=ref.num)
temp=temp+1;
else
{
System.out.println("the next prime is "+j);
break;
}
}
}
public static void main(String args[])
{
nextprime obj=new nextprime();
nextprime obj1=new nextprime(obj);
}
}