var
i,n,s, k : integer;
begin
s:=0;
readln (n);
for i:= 1 to n do begin
readln (k);
if k mod 10 =0 then s:= s+k;
end;
writeln (s);
end.
var
i,n,s, k : integer;
begin
s:=0;
readln (n);
for i:= 1 to n do begin
readln (k);
if k mod 10 =0 then s:= s+k;
end;
writeln (s);
end.