program PascalGuru;
var s,slovo:string;
sogl:set of char;
i,p,kol:integer;
begin
sogl:=['B', 'C', 'D', 'F', 'G', 'H', 'J', 'K',
'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Z'];
write('Predlojenie: '); readln (s);
i:=1;
repeat
if copy(s,i,2)=' ' then delete(s,i,1) else inc(i);
until i>length(s);
kol:=0;
p:=pos(' ',s);
repeat
slovo:=copy(s,1,p-1);
delete(s,1,p);
p:=pos(' ',s);
if upcase(slovo[length(slovo)]) in sogl then inc(kol);
until p=0;
if upcase(s[length(s)]) in sogl then inc(kol);
writeln('Kol-vo: ',kol);
readln;
end.