#include <bits/stdc++.h>
using namespace std;
void solve(void);
int main() {
  {
    { solve(); }
  }
  return 0;
}
void solve() {
  long long int n, i, ans = 0, ans1, ans2;
  cin >> n;
  long long int a[n];
  vector<long long int> v;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    v.push_back(a[i]);
  }
  sort(a, a + n);
  sort(v.rbegin(), v.rend());
  for (i = 0; i < n; i++) {
    if (a[i] > 0) ans += a[i];
  }
  if (ans % 2 != 0) {
    cout << ans << endl;
  } else {
    bool ok = 0, ok1 = 0;
    ans1 = ans;
    ans2 = ans;
    for (i = 0; i < n; i++) {
      if (v[i] < 0 && v[i] % 2 != 0) {
        ans1 += v[i];
        ok = 1;
        break;
      }
    }
    for (i = 0; i < n; i++) {
      if (a[i] > 0 && a[i] % 2 != 0) {
        ans2 -= a[i];
        ok1 = 1;
        break;
      }
    }
    if (ok == 1 && ok1 == 1)
      cout << max(ans1, ans2) << endl;
    else if (ok == 1)
      cout << ans1 << endl;
    else if (ok1 == 1)
      cout << ans2 << endl;
  }
}
