#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int sum = 0;
  int maxNe = -1e4 - 1;
  int minPo = 1e4 + 1;
  for (int i = 0; i < n; ++i) {
    int no;
    cin >> no;
    if (no >= 0) {
      sum += no;
      if (no & 1) {
        minPo = min(minPo, no);
      }
    } else {
      if (no & 1) {
        maxNe = max(maxNe, no);
      }
    }
  }
  if (sum & 1) {
    cout << sum;
  } else {
    cout << max(sum + maxNe, sum - minPo);
  }
}
