program sieve;

const
  size = 8190;

var
  flags: array [0..size] of boolean;
  i, k, prime, count, iter: integer;

begin
  writeln('10 Iterations');
  for iter := 1 to 100 do begin
    for i := 0 to size do flags[i] := true;
    count := 0;
    for i := 0 to size do begin
      if flags[i] then begin
        prime := i + i + 3;
        k := i + prime;
        while k <= size do begin
          flags[k] := false;
          k := k + prime;
        end;
        count := count +  1;
      end;
    end;
  end;
  writeln(count, ' primes');
end.
