#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2e5 + 3;
const int M = 1e6 + 7;
const long long MOD = 1e9 + 7;
const long long INF = 1e18 + 9;
const int SM = 1e3 + 5;
const int logN = 20, BL = 400;
const double EPS = 3e-16;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n), posOdd, negOdd;
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0 && a[i] % 2) posOdd.push_back(a[i]);
    if (a[i] < 0 && a[i] % 2) negOdd.push_back(a[i]);
    if (a[i] > 0) sum += a[i];
  }
  sort(posOdd.begin(), posOdd.end());
  sort(negOdd.begin(), negOdd.end(), greater<long long>());
  if (sum & 1)
    cout << sum;
  else {
    long long x = sum;
    if (posOdd.size() > 0)
      x -= posOdd[0];
    else
      x = -INF;
    long long y = sum;
    if (negOdd.size() > 0)
      y += negOdd[0];
    else
      y = -INF;
    cout << max(x, y);
  }
  return 0;
}
