program Dwite2 (input,output);
uses crt;
const spc=#32;
      null=#0;
      enter=#13;
var fin,fout: text;
    count: integer;
    n: integer;
    s: string;
    x: integer;


begin
 assign (fin,'DATA2.txt');
 reset (fin);
 assign (fout,'OUT2.txt');
 rewrite (fout);
 while not eof(fin) do
 begin
 count:=0;
 n:=0;
 readln (fin,s);
 for x:=1 to length(s) do
  begin
     s[x]:=upcase (s[x]);
     if count=4 then
      n:=n+1;
      if not ((ord(s[x])<90) and (ord(s[x])>64)) then
       count:=0
     else
     if (s[x]=spc) then
       count:=0
     else

         count:=count+1;
  end;

 writeln (fout,n);

 end;
 close (fin);
 close (fout);
 end.


