#include <bits/stdc++.h>
using namespace std;
vector<int> mas;
int n;
int main() {
  int a;
  cin >> n;
  vector<char> mask(n, '0');
  for (int i = 0; i < n; ++i) {
    cin >> a;
    mas.push_back(a);
  }
  bool flag = false;
  bool flag2 = false;
  int i = 0;
  int i2 = 0;
  while (!flag && !flag2) {
    while (mas[i2] % 2 != 0 || mask[i2] == '1') {
      ++i2;
      if (i2 >= n) {
        flag2 = true;
        --i2;
        break;
      }
    }
    if (!flag) mask[i2] = '1';
    while (mas[i] % 2 == 0 || mask[i] == '1') {
      ++i;
      if (i >= n) {
        --i;
        flag = true;
        break;
      }
    }
    if (!flag) mask[i] = '1';
  }
  if (flag == true && mas[i2] % 2 == 0) mask[i2] = '1';
  if (flag2 == true && mas[i] % 2 != 0) mask[i] = '1';
  int sum = 0;
  for (int i = 0; i < n; ++i)
    if (mask[i] == '0') sum += mas[i];
  cout << sum;
  cout << endl;
}
