1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.util.Iterator;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
 * Created by gmatuszewski on 28.09.2015.
 */
public class kie {

	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		Iterator<String> lineInterator = new Iterator<String>() {
			@Override
			public boolean hasNext() {
				return sc.hasNextLine();
			}

			@Override
			public String next() {
				return sc.nextLine();
			}
		};

		System.out.println(kie(lineInterator));
		System.exit(0);
	}

	public static String kie(Iterator<String> lines){
		int n = Integer.parseInt(lines.next());
		StringTokenizer st = new StringTokenizer(lines.next());

		int min = Integer.MAX_VALUE;
		long sum = 0;
		boolean odd = false;

		while (n-- > 0){
			int a = Integer.parseInt(st.nextToken());
			if (a % 2 == 1){
				odd = !odd;
				min = Math.min(min, a);
			}
			sum += a;
		}

		if (odd)
			sum -= min;

		return sum == 0 ? "NIESTETY" : Long.toString(sum);
	}

}