#include <bits/stdc++.h>
using namespace std;
int odd = 111111111, ne_odd = -111111111, n;
int a[500000];
vector<int> v[3];
int main() {
  cin >> n;
  int s = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] > 0) s += a[i];
    if (a[i] < 0 && (a[i] & 1)) ne_odd = max(ne_odd, a[i]);
    if (a[i] > 0 && (a[i] & 1)) odd = min(odd, a[i]);
  }
  if (!(s & 1)) {
    if (ne_odd < 0 && odd > 0)
      if (abs(ne_odd) < odd)
        s += ne_odd;
      else
        s -= odd;
  }
  cout << s << "\n";
  return 0;
}
