#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a, i, p, q, sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0;
  vector<long long> even, neg_even, odd, neg_odd;
  for (i = 1; i <= n; i++) {
    cin >> a;
    if (a % 2 != 0) {
      if (a < 0)
        neg_odd.push_back(a), sum1 += a;
      else
        odd.push_back(a), sum2 += a;
    } else {
      if (a < 0)
        neg_even.push_back(a), sum3 += a;
      else
        even.push_back(a), sum4 += a;
    }
  }
  sort(neg_odd.begin(), neg_odd.end());
  sort(odd.begin(), odd.end());
  sort(neg_even.begin(), neg_even.end());
  sort(even.begin(), even.end());
  if (sum2 > 0) {
    if (sum2 % 2 == 0) {
      p = sum2 - odd[0];
      if (neg_odd.size() > 0) {
        q = sum2 + neg_odd[neg_odd.size() - 1];
        sum2 = max(p, q);
      } else
        sum2 = p;
    }
    cout << sum4 + sum2 << endl;
  } else {
    sum1 = neg_odd[neg_odd.size() - 1];
    cout << sum1 + sum4 << endl;
  }
  return 0;
}
