var i,count:integer;
var stroka:string;
begin
writeln('Vvedite stroku');
readln(stroka);
for i:=1 to length(stroka) do begin
if(stroka[i] = 'н') and (stroka[i+1]= ' ') then inc(count);
if(i=length(stroka)) and (stroka[i] = 'н') then inc(count);
end;
writeln(count);
readln;
end.