var
a:array [1..100] of integer;
i,n:integer;
p:longint;
begin
write ('N = ');readln(n);
for i:=1 to n do begin
write ('A[',i,'] = ');readln(a[i]);
end;
writeln;
p:=1;
for i:=1 to n do
if ((a[i] div 10 <> 0) and (a[i] mod 2 = 0)) and ((a[i] div 10 = 5) or (a[i] div 10 = 6)) then
p:=p*a[i];
writeln (p);
readln;
end.