#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<long long int> odd, even;
  for (int i = 0; i < n; i++) {
    long long int d;
    cin >> d;
    if (d % 2)
      odd.push_back(d);
    else
      even.push_back(d);
  }
  sort(even.begin(), even.end());
  sort(odd.begin(), odd.end());
  long long int maxn = odd[odd.size() - 1];
  long long int temp = maxn;
  long long int ele = 1;
  long long int cnt = 1;
  for (int i = odd.size() - 2; i >= 0; i--) {
    temp += odd[i];
    cnt++;
    if (temp >= maxn && cnt % 2 == 1) {
      maxn = temp;
      ele++;
    }
  }
  temp = maxn;
  for (int i = even.size() - 1; i >= 0; i--) {
    temp += even[i];
    if (temp >= maxn) {
      maxn = temp;
    } else
      break;
  }
  cout << maxn << endl;
  return 0;
}
