var a:string;i:integer;beginreadln(a);a:=a+' ';while length(a)>0 do beginif a[1]='a' then inc(i);delete(a,1,pos(' ',a));end;writeln(i);end.
var a:string;
i:integer;
begin
readln(a);
a:=a+' ';
while length(a)>0 do begin
if a[1]='a' then inc(i);
delete(a,1,pos(' ',a));
end;
writeln(i);
end.