var
count, min, max: integer;
str: string;
begin
min := 191;
max := 149;
readln(str);
while (str <> '!') do
begin
if (str.ToInteger in [150..190]) then
begin
if (str.ToInteger > max) then max := str.ToInteger
else if (str.ToInteger < min) then min := str.ToInteger;
count := count + 1;
end;
readln(str);
end;
writeln(count);
write(min, ' ', max);
end.