#include <bits/stdc++.h>
using namespace std;
int a[2005];
int main() {
  int i, j, k, n, ji = 0, ou = 0, word = 0, sum1 = 0, sum2 = 0, s = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] % 2 == 0)
      ou++;
    else
      ji++;
  }
  sort(a, a + n);
  if (a[n - 1] % 2 == 0) {
    s = 1;
    word = 0;
    a[n - 1] = 0;
    for (i = n - 2; i >= 0; i--) {
      if (!word && a[i] % 2 != 0) {
        a[i] = 0;
        word = !word;
      } else if (word && a[i] % 2 == 0) {
        a[i] = 0;
        word = !word;
      }
    }
    for (i = 0; i < n; i++) {
      sum1 += a[i];
    }
  } else {
    s = 2;
    word = 0;
    a[n - 1] = 0;
    for (i = n - 2; i >= 0; i--) {
      if (!word && a[i] % 2 == 0) {
        a[i] = 0;
        word = !word;
      } else if (word && a[i] % 2 != 0) {
        a[i] = 0;
        word = !word;
      }
    }
    for (i = 0; i < n; i++) {
      sum2 += a[i];
    }
  }
  if (s == 1)
    printf("%d", sum1);
  else
    printf("%d", sum2);
}
