#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 */
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  long long int ans = 0;
  int odd = 0, n, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &j);
    ans += j;
    if (j % 2 && (odd > j || odd == 0))
      odd = j;
  }
  if (ans % 2)
    printf("%I64d\n", ans - odd);
  else
    printf("%I64d\n", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xeb4(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11c7 <main+0xa7>
lea    0xe91(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x28(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b4 <main+0x94>
mov    -0x1c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jg     11ae <main+0x8e>
cmpl   $0x0,-0x1c(%rbp)
jne    11b4 <main+0x94>
mov    -0x28(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11b9 <main+0x99>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115c <main+0x3c>
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     11fb <main+0xdb>
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
sub    %rax,%rsi
lea    0xe12(%rip),%rdi
call   1030 <printf@plt>
jmp    120b <main+0xeb>
mov    -0x18(%rbp),%rsi
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
xor    %ebx,%ebx
cmpl   $0x0,(%rsp)
jle    119d <main+0x7d>
lea    0xeb7(%rip),%r14
lea    0x4(%rsp),%r15
xor    %ebp,%ebp
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%r13d
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
add    %rax,%r12
cmp    %eax,%ebp
cmovg  %eax,%ebp
test   %r13d,%r13d
cmove  %eax,%ebp
test   $0x1,%al
cmove  %r13d,%ebp
add    $0x1,%ebx
cmp    (%rsp),%ebx
jl     1160 <main+0x40>
test   $0x1,%r12b
je     11a0 <main+0x80>
movslq %ebp,%rax
sub    %rax,%r12
jmp    11a0 <main+0x80>
xor    %r12d,%r12d
lea    0xe5c(%rip),%rdi
mov    %r12,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%I64d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
store i32 0, i32* %7
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
store i32 0, i32* %9
br label %12
12: ; preds = %35, %2
%13 = load i32, i32* %9
%14 = load i32, i32* %8
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %38
16: ; preds = %12
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
%18 = load i32, i32* %10
%19 = sext i32 %18 to i64
%20 = load i64, i64* %6
%21 = add nsw i64 %20, %19
store i64 %21, i64* %6
%22 = load i32, i32* %10
%23 = srem i32 %22, 2
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %16
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = icmp sgt i32 %26, %27
br i1 %28, label %32, label %29
29: ; preds = %25
%30 = load i32, i32* %7
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %29, %25
%33 = load i32, i32* %10
store i32 %33, i32* %7
br label %34
34: ; preds = %32, %29, %16
br label %35
35: ; preds = %34
%36 = load i32, i32* %9
%37 = add nsw i32 %36, 1
store i32 %37, i32* %9
br label %12
38: ; preds = %12
%39 = load i64, i64* %6
%40 = srem i64 %39, 2
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = load i64, i64* %6
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = sub nsw i64 %43, %45
%47 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %46)
br label %51
48: ; preds = %38
%49 = load i64, i64* %6
%50 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %49)
br label %51
51: ; preds = %48, %42
ret i32 0
}

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