#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int Max = 1e5 + 5;
const long long IFN = 1e18 + 5;
inline void norm(long long &a) {
  a %= mod;
  (a < 0) && (a += mod);
}
inline long long modAdd(long long a, long long b) {
  a %= mod, b %= mod;
  norm(a), norm(b);
  return (a + b) % mod;
}
inline long long modSub(long long a, long long b) {
  a %= mod, b %= mod;
  norm(a), norm(b);
  return (a - b) % mod;
}
inline long long modMul(long long a, long long b) {
  a %= mod, b %= mod;
  norm(a), norm(b);
  return (a * b) % mod;
}
void F_I_O() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
int main() {
  int t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long a;
    vector<long long> odd, even;
    for (int i = 0; i < n; i++) {
      cin >> a;
      if (a % 2) {
        odd.push_back(a);
      } else {
        even.push_back(a);
      }
    }
    sort(odd.rbegin(), odd.rend());
    sort(even.rbegin(), even.rend());
    long long ans = -100000000000000000;
    long long cnt = 0;
    int len1 = odd.size();
    int len2 = even.size();
    long long sum = 0;
    for (int k = 0; k < len1; k++) {
      sum += odd[k];
      if (sum % 2) {
        ans = max(ans, sum);
      }
    }
    sum = ans;
    for (int k = 0; k < len2; k++) {
      sum += even[k];
      if (sum % 2) {
        ans = max(ans, sum);
      }
    }
    cout << ans << '\n';
  }
}
