read x
if((x==2))
then
    echo 2
    exit
elif((x%2==0))
then
    x=$((x+1))
fi
for i in `seq $x 2 100003`
do
    l=`echo $i | factor | tr ' ' '\n' | wc -l`
    if((l==2))
    then
        echo $i
        exit
    fi
done