function isPrime(num: integer): boolean;
begin
result := num > 1 ? true : false;
for var i := 2 to (num div 2) do
if (num mod i = 0) then
begin
result := false;
break
end;
end;
begin
var list := new List;
var (n, i) := (40, 0);
var count := 0;
while (n < 61) do
begin
if isPrime(n) then
begin
list.Add(n);
count += 1;
end;
n += 1;
end;
list.Println;
writelnFormat('Count = {0}', Count);
end.