Program HOC24;
var i,n: integer;
a: array[1..32000] of integer;
t: longint;
begin
write('Nhap N: '); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
begin
if a[i]<500 then t:=t+a[i];
write('Tong cac phan tu be hon 500 la: ',t);
readln
end.