uses crt;
function Prim(a:longint):boolean;
var i:longint;
f:boolean;
begin
if a<2 then f:=false
else
begin
f:=true;
i:=2;
while (i*i<=a) and f do
if a mod i=0 then f:=false
else i:=i+1;
end;
Prim:=f;
end;
var n:integer;
begin
clrscr;
writeln('Introduce-ti un numar natural n=');
readln(n);
if Prim(n)then writeln('Prim')
else writeln('Nu este prim');
readln
end.