var toan,van,tong:array [1..100] of real;
i,n,g,k,y,tb:integer;
max,min:real;
begin
write('Nhap so hoc sinh :');readln(n);
for i:=1 to n do
begin
write('Nhap diem toan cua hs ',i,' :');readln(toan[i]);
write('Nhap diem van cua hs ',i,' :');readln(van[i]);
tong[i]:=(van[i]+toan[i])/2;
if tong[i]<min then min:=tong[i];
if tong[i]>max then max:=tong[i];
if tong[i]>=8 then inc(g) else
if tong[i]>=6.5 then inc(k) else
if tong[i]>=5 then inc(tb) else inc(y);
end;
writeln('So hoc sinh gioi la ',g);
writeln('So hoc sinh kha la ',k);
writeln('So hoc sinh trung binh la ',tb);
writeln('So hoc sinh yeu la ',y);
writeln('Diem thap nhat la ',min);
writeln('Diem cao nhat la ',max);
readln;
end.