var s :string; i, kol :integer; sch :boolean; begin readln(s); sch:= false; for i:= 1 to length(s) do begin if (s[i] = ' ') and (sch = true) then kol:= kol else if s[i] = ' ' then begin inc(kol); sch:= true; end else sch:= false; end; writeln(kol+1); end.