Program HOC24;
var i,n: integer;
t: longint;
a: array[1..100] of integer;
procedure ip;
begin
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
end;
function chan(x: integer): longint;
var tong: longint;
begin
t:=0;
if x mod 2=0 then tong:=x;
chan:=tong;
end;
begin
ip;
for i:=1 to n do t:=t+chan(a[i]);
write(t);
readln
end.