#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n, a[maxn];
int main() {
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0) sum += a[i];
  }
  if (sum & 1)
    cout << sum << endl;
  else {
    int mi = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] > 0 && (a[i] & 1)) {
        if (mi == 0 || mi > a[i]) mi = a[i];
      }
    }
    int sum1 = mi ? sum - mi : -1000000007;
    int mx = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] < 0 && ((-a[i]) & 1)) {
        if (mx == 0 || mx < a[i]) mx = a[i];
      }
    }
    int sum2 = mx ? sum + mx : -1000000007;
    cout << max(sum1, sum2) << endl;
  }
  return 0;
}
