var a,i,b,s:longint; begin assign(input,'input.txt'); assign(output,'output.txt'); reset(input); rewrite(output); while not(eof(input)) do begin read(s); for i:=1 to length(s) do if s[i]='!' then n:=n+1; writeln(n); n:=0; end; end.