Pascal ABC
var
n, sum, a, i:integer;
begin
readln(n);
for i:=1 to n do begin
readln(a);
if (a mod 6 = 0) and (a mod 10 = 8) then
sum := sum + a;
end;
writeln(sum);
end.
Pascal ABC
var
n, sum, a, i:integer;
begin
readln(n);
for i:=1 to n do begin
readln(a);
if (a mod 6 = 0) and (a mod 10 = 8) then
sum := sum + a;
end;
writeln(sum);
end.