program Stroki2;
var s : string;
i : integer;
in_word : boolean;
count : integer;
const letters : set of char = ['a'..'z', 'A'..'Z'];
begin
count:=0; in_word:=false;
readLn(s);
for i:=1 to length(s) do
begin
if (s[i] in letters) and (not in_word) then
begin
in_word:=true; inc(count)
end
else if not (s[i] in letters) and in_word then
begin
in_word:=false
end
end;
writeLn(count);
readln;
end.