#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, mn = 100009, mx = -100009, sum = 0;
  ;
  cin >> n;
  while (n--) {
    cin >> x;
    if (x > 0) {
      sum += x;
      if (x % 2 == 1) mn = min(mn, x);
    } else {
      if (x % 2 == -1) mx = max(mx, x);
    }
  }
  if (sum % 2 == 1)
    cout << sum << endl;
  else {
    int ans = max(sum - mn, sum + mx);
    cout << ans << endl;
  }
  return 0;
}
