var
s : string;
flag : boolean;
i, c : integer;
begin
readln (s);
c := 0; flag := false;
for i := 1 to length (s) do
begin
if flag then
begin
if s[i] = ' ' then flag := false;
end
else
if s[i] <> ' ' then
begin
inc (c);
flag := true;
end;
begin
end;
end;
writeln (c);
end.