program TinhTongSoNguyenTo;
var
X, Y, i, j, dem, tong: integer;
begin
write('Nhap X: ');
readln(X);
write('Nhap Y: ');
readln(Y);
tong := 0;
for i := X to Y do
begin
dem := 0;
for j := 2 to i div 2 do
if i mod j = 0 then
begin
dem := dem + 1;
break;
end;
if dem = 0 then
tong := tong + i;
end;
writeln('Tong cac so nguyen to tu ', X, ' den ', Y, ' la: ', tong);
readln;
end.