#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int n, result, flag, d;
  while (EOF != scanf("%d", &n)) {
    flag = 0;
    while (n--) {
      scanf("%d", &d);
      if (d % 2 == 1) {
        if (flag == 0) {
          flag = 1;
          result = d;
        } else {
          result *= d;
        }
      }
    }
    printf("%d\n", result);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     11e0 <main+0xc0>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     11cc <main+0xac>
lea    0xe81(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11c7 <main+0xa7>
cmpl   $0x0,-0x10(%rbp)
jne    11b8 <main+0x98>
movl   $0x1,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11c2 <main+0xa2>
mov    -0x14(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11c7 <main+0xa7>
jmp    1164 <main+0x44>
mov    -0xc(%rbp),%esi
lea    0xe2d(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2eb6(%rip),%rax
mov    (%rax),%rbx
lea    0xec4(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmp    %rax,%rbx
jne    115a <main+0x3a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe9f(%rip),%rbx
mov    %rsp,%r15
lea    0x4(%rsp),%r12
mov    $0x1,%r13d
jmp    11a8 <main+0x88>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe7c(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%r14
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    %rax,%r14
je     1149 <main+0x29>
subl   $0x1,(%rsp)
jb     1180 <main+0x60>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
mov    %eax,%edx
sub    %ecx,%edx
test   %r14d,%r14d
mov    %ebp,%ecx
cmove  %r13d,%ecx
imul   %eax,%ecx
cmp    $0x1,%edx
cmove  %ecx,%ebp
cmove  %edx,%r14d
subl   $0x1,(%rsp)
jae    11c0 <main+0xa0>
jmp    1180 <main+0x60>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %31, %0
%7 = load i64, i64* @EOF
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %34
10: ; preds = %6
store i32 0, i32* %4
br label %11
11: ; preds = %30, %10
%12 = load i32, i32* %2
%13 = add nsw i32 %12, -1
store i32 %13, i32* %2
%14 = icmp ne i32 %12, 0
br i1 %14, label %15, label %31
15: ; preds = %11
%16 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%17 = load i32, i32* %5
%18 = srem i32 %17, 2
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %30
20: ; preds = %15
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
store i32 1, i32* %4
%24 = load i32, i32* %5
store i32 %24, i32* %3
br label %29
25: ; preds = %20
%26 = load i32, i32* %5
%27 = load i32, i32* %3
%28 = mul nsw i32 %27, %26
store i32 %28, i32* %3
br label %29
29: ; preds = %25, %23
br label %30
30: ; preds = %29, %15
br label %11
31: ; preds = %11
%32 = load i32, i32* %3
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %6
34: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i64, i64* @EOF
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = icmp eq i64 %5, %6
br i1 %7, label %34, label %8
8: ; preds = %0, %28
%9 = phi i32 [ %29, %28 ], [ undef, %0 ]
%10 = load i32, i32* %1
%11 = add nsw i32 %10, -1
store i32 %11, i32* %1
%12 = icmp eq i32 %10, 0
br i1 %12, label %28, label %13
13: ; preds = %8, %13
%14 = phi i32 [ %24, %13 ], [ 0, %8 ]
%15 = phi i32 [ %23, %13 ], [ %9, %8 ]
%16 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %2
%18 = srem i32 %17, 2
%19 = icmp eq i32 %18, 1
%20 = icmp eq i32 %14, 0
%21 = select i1 %20, i32 1, i32 %15
%22 = mul nsw i32 %17, %21
%23 = select i1 %19, i32 %22, i32 %15
%24 = select i1 %19, i32 1, i32 %14
%25 = load i32, i32* %1
%26 = add nsw i32 %25, -1
store i32 %26, i32* %1
%27 = icmp eq i32 %25, 0
br i1 %27, label %28, label %13
28: ; preds = %13, %8
%29 = phi i32 [ %9, %8 ], [ %23, %13 ]
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i64, i64* @EOF
%32 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%33 = icmp eq i64 %31, %32
br i1 %33, label %34, label %8
34: ; preds = %28, %0
ret i32 0
}