var
land, air, water, x: integer;
temp: string;
begin
land := 0;
air := 0
water := 0;
x := 0;
//an infinite loop broken by 'xxxxx'
while (true) do
begin
temp = copy(stdin, x, 5);
if temp = ''xxxxx' then
break;
if copy(temp, 1, 3) = 'air' then
begin
air := air + 1;
continue;
end;
if copy(temp, 1, 4) = 'land' then
begin
land := land + 1;
continue;
end;
temp = 'water' then
begin
water := water + 1;
continue;
end;
x := x + 1;
end;
printline('air ' + IntToStr(air));
printline('water ' + IntToStr(water));
printline('land ' + IntToStr(land));
end;