#include <bits/stdc++.h>
using namespace std;
int n, s, a, mink = 10000000, k = -10000000, t = 0, r;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a > 0) s += a;
    if (a > 0 && a % 2 == 1) mink = min(mink, a);
    if (a < 0 && abs(a) % 2 == 1) k = max(a, k);
  }
  if (s % 2 == 1)
    cout << s << endl;
  else {
    if (mink != 10000000 && k != -10000000)
      cout << s - min(mink, abs(k)) << endl;
    if (mink == 10000000 && k != -10000000) cout << s + k << endl;
    if (mink != 10000000 && k == -10000000) cout << s - mink << endl;
  }
}
