Var
a, i: integer;
s, fio: string;
begin
readln(s);
s := Trim(s);
writeln('Length = ', length(s));
for i := 1 to length(s) do
begin
if s[i] = 'а' then a := a + 1;
if (i = 1) or (s[i - 1] = ' ') then fio := fio + UpCase(s[i]) + '.';
end;
writeln('A = ', a);
writeln(fio);
end.