uses
crt;
var
s,temp:string;
i,c,k:integer;
begin
clrscr;
writeln('Vvedite stroku...');
readln(s);
writeln('Dlina...');
readln(k);
temp:='';
c:=0;
for i:=1 to length(s) do
begin
if s[i]<>' ' then
temp:=temp+s[i];
if ((s[i]=' ') or (i=length(s))) and (temp<>'') then
begin
if Length(temp)=k then
inc(c);
temp:='';
end;
end;
Writeln('Result: ',c)
end.