uses crt;
var st:string;
a:array[1..255]of string;
i,n,d,kt,j,dem,dem1,dem2:integer;
begin
clrscr;
readln(st);
d:=length(st);
dem:=1;
a[1]:=st[1];
for i:=1 to d do
begin
kt:=0;
for j:=1 to dem do
if a[j]=st[i] then kt:=1;
if kt=0 then
begin
dem:=dem+1;
a[dem]:=st[i];
end;
end;
dem1:=0;
dem2:=0;
for i:=1 to dem do
begin
if st[i] in ['A'..'Z'] then dem1:=dem1+1;
if st[i] in ['a'..'z'] then inc(dem1);
if st[i] in ['0'..'9'] then inc(dem2);
end;
writeln(dem1);
writeln(dem2);
readln;
end.