var s: string;
i,k: integer;
begin
readln(s);
k:=0;
if s[1]<>' ' then insert(' ',s,1);
for i:=1 to length(s)-1 do
if (s[i]=' ') and (s[i+1]='a') then
k:=k+1;
write('k=',k);
end.
var s: string;
i,k: integer;
begin
readln(s);
k:=0;
if s[1]<>' ' then insert(' ',s,1);
for i:=1 to length(s)-1 do
if (s[i]=' ') and (s[i+1]='a') then
k:=k+1;
write('k=',k);
end.