var
digits, letters, spaces, count: integer;
line: string;
begin
Readln(line);
count := Length(line);
while count > 0 do
begin
if line[count] in ['0' .. '9'] then
digits := digits + 1
else if line[count] = ' ' then
spaces := spaces + 1
else if line[count] in ['A' .. 'Z', 'a' .. 'z', 'А' .. 'Я', 'а' .. 'я'] then
letters := letters + 1 count := count - 1
end;
writeln(digits);
writeln(letters);
writeln(spaces);
end.