#include <bits/stdc++.h>
using namespace std;
int arr[2001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string str;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  bool flag = 1;
  bool even;
  if (arr[n - 1] % 2 == 0)
    even = 1;
  else
    even = 0;
  arr[n - 1] = -1;
  int j;
  bool last;
  for (j = n - 1; j >= 0; j--) {
    if (even) {
      if (arr[j] % 2 == 1) {
        arr[j] = -1;
        even = 0;
        j = n;
        last = 0;
      }
    } else {
      if (arr[j] % 2 == 0) {
        arr[j] = -1;
        even = 1;
        j = n;
        last = 1;
      }
    }
  }
  for (j = n - 1; j >= 0; j--) {
    if (!last) {
      if (arr[j] % 2 == 1) {
        arr[j] = -1;
        break;
      }
    } else if (arr[j] % 2 == 0) {
      arr[j] = -1;
      break;
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i] > 0) ans += arr[i];
  }
  cout << ans;
}
