var
s : string;
i, max, j : integer;
begin
write('s = ');
readln(s);
s:=s+'.';
max:=0;
j:=0;
For i:=1 to Length(s) do
If s[i]=' ' then Inc(j)
else
Begin
If j>max then max:=j;
j:=0;
End;
writeln('Максимальное количество пробелов ',max);
readln;
end.