#include <bits/stdc++.h>
using namespace std;
void __dbg() { cout << endl; }
template <typename Arg, typename... Args>
void __dbg(Arg A, Args... B) {
  cout << ' ' << A;
  __dbg(B...);
}
const int inf = INT_MAX;
const int ninf = INT_MIN;
const int mod = 1e9 + 7;
const int maxN = 1e6 + 2;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> pos, neg;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (x > 0) {
      pos.push_back(x);
      sum += x;
    }
    if (x < 0) {
      neg.push_back(x);
    }
  }
  if (sum & 1) {
    printf("%d\n", sum);
    exit(0);
  }
  sort(pos.begin(), pos.end());
  sort(neg.rbegin(), neg.rend());
  int mx = ninf;
  for (int i = 0; i < pos.size(); i++) {
    if (((sum - pos[i]) % 2) && (sum - pos[i]) > mx) {
      mx = sum - pos[i];
      break;
    }
  }
  for (int i = 0; i < neg.size(); i++) {
    if (((sum + neg[i]) % 2) && (sum + neg[i]) > mx) {
      mx = sum + neg[i];
      break;
    }
  }
  printf("%d\n", mx);
  return 0;
}
