var l,k:char; m,s:string; n,i,a:integer; begin read(s); l:=s[1]; if ((ord(l)>223) and (ord(l)<256))or((ord(l)>96) and (ord(l)<122)) then begin a:=ord(l)-32;if a<>0 then begin k:=chr(a);if k<>'0' then m:=m+copy(k,1,1) end; end else begin if ord(l)=44 then n:=n+1; m:=m+l; end; l:=s[2]; if ((ord(l)>223) and (ord(l)<256))or((ord(l)>96) and (ord(l)<122)) then begin a:=ord(l)-32;if a<>0 then begin k:=chr(a);if k<>'0' then m:=m+copy(k,1,1) end; end else begin if ord(l)=44 then n:=n+1; m:=m+l; end; l:=s[3]; if ((ord(l)>223) and (ord(l)<256))or((ord(l)>96) and (ord(l)<122)) then begin a:=ord(l)-32;if a<>0 then begin k:=chr(a);if k<>'0' then m:=m+copy(k,1,1) end; end else begin if ord(l)=44 then n:=n+1; m:=m+l; end; l:=s[4]; if ((ord(l)>223) and (ord(l)<256))or((ord(l)>96) and (ord(l)<122)) then begin a:=ord(l)-32;if a<>0 then begin k:=chr(a);if k<>'0' then m:=m+copy(k,1,1) end; end else begin if ord(l)=44 then n:=n+1; m:=m+l; end; l:=s[5]; if ((ord(l)>223) and (ord(l)<256))or((ord(l)>96) and (ord(l)<122)) then<span> begin a:=ord(l)-32;if a<>0 then begin k:=chr(a);if k<>'0' then m:=m+copy(k,1,1) end; end else begin if ord(l)=44 then n:=n+1; m:=m+l; end; l:=s[6]; if ((ord(l)>223) and (ord(l)<256))or((ord(l)>96) and (ord(l)<122)) then begin a:=ord(l)-32;if a<>0 then begin k:=chr(a);if k<>'0' then m:=m+copy(k,1,1) end; end else begin if ord(l)=44 then n:=n+1; m:=m+l; end; writeln(m); writeln(n); end.