program so_nguyen_to;
Uses crt;
Var
n:longint;
function NT(x:longint):boolean;
begin
NT:=true;
If x<2 then NT:=false else
Begin
i:=2;
while n mod i<>0 do i:=i+1;
If i=n then NT:=true else NT:=false;
End;
End;
Function SNT(a:longint):boolean;
Var
d,so:longint;
Begin
SNT:=true;
if NT(a) then
Begin
D:=1; so:=0;
while a<>0 do
Begin
inc(so); a:=a div 10; if NT(a) then inc(d);
End;
If d=so then SNT:=true else SNT:=false;
End else SNT:=false;
end;
Begin
clrscr;
write('Nhap so muon kiem tra: '); readln(n);
If SNT(n) then write(n,' la so sieu nguyen to') else write(n,' khong la so sieu nguyen to');
Readln;
End.