var
a,b,i,count:integer;
begin
i:=100;
repeat
b:=i;
a:=1;
while b>0 do
a:=a * (b mod 10);
b:=b div 10;
end;
if a < 8 then
inc(count);
write(i:4);
inc(i);
until i>=999;
writeln;
writeln('Count: ',count);
end.
var
a,b,i,count:integer;
begin
i:=100;
repeat
b:=i;
a:=1;
while b>0 do
begin
a:=a * (b mod 10);
b:=b div 10;
end;
if a < 8 then
begin
inc(count);
write(i:4);
end;
inc(i);
until i>=999;
writeln;
writeln('Count: ',count);
end.