#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  vector<int> v(n), pos, neg;
  bool negpre = false, pospre = false;
  int minneg = INT_MAX, minpos = INT_MAX;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] > 0) {
      sum += v[i];
      if (v[i] & 1) {
        minpos = min(minpos, v[i]);
        pospre = true;
      }
    } else if (v[i] < 0) {
      if (abs(v[i]) & 1) {
        negpre = true;
        minneg = min(minneg, abs(v[i]));
      }
    }
  }
  if (sum & 1) {
    cout << sum;
    return 0;
  }
  if (negpre && pospre) {
    int x = min(minneg, minpos);
    cout << sum - x;
    return 0;
  }
  if (pospre) {
    cout << sum - minpos;
    return 0;
  }
  if (negpre) {
    cout << sum - minneg;
    return 0;
  }
}
