uses crt;
var n,i,kt,t,x,y:integer;
st:string;
begin
clrscr;
write('Nhap n=');readln(n);
if n>1 then
begin
kt:=0;
for i:=2 to n-1 do
if n mod i=0 then kt:=1;
if kt=0 then writeln(n,' la so nguyen to')
else writeln(n,' khong la so nguyen to');
end
else writeln(n,' khong la so nguyen to');
str(n,st);
writeln('So chu so cua ',n,' la: ',length(st));
t:=0;
for i:=1 to length(st) do
begin
val(st[i],x,y);
t:=t+x;
end;
writeln('Tong cac chu so cua ',n,' la: ',t);
readln;
end.