const fi='vao.txt'
fo='dulieu.txt'
var f1,f2:text;
st:string;
d,i,dem:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,st);
while st[1]=#32 do
delete(st,1,1);
while st[length(st)]=#32 do
delete(st,length(st),1);
for i:=1 to length(st) do
if (st[i]=#32) and (st[i+1]=#32) then delete(st,i,1);
d:=length(st);
dem:=0;
for i:=1 to d do
if st[i]=#32 then inc(dem);
writeln(f2,dem+1);
close(f1);
close(f2);
end.