#include <bits/stdc++.h>
using namespace std;
vector<int> odd;
int main() {
  int n, t;
  cin >> n;
  long long cnt = 0, res = -1e9;
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (abs(t) % 2 == 1)
      odd.push_back(t);
    else if (t > 0)
      cnt += t;
  }
  sort(odd.begin(), odd.end());
  bool flag = 0;
  int sz = odd.size();
  for (int i = sz - 1; i >= 0; i--) {
    cnt += odd[i];
    if (abs(cnt) % 2 == 1) res = max(cnt, res);
  }
  cout << res << endl;
}
