#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000000 + 5;
int n, a[maxn];
vector<int> vec;
int main() {
  memset(a, 0, sizeof(a));
  cin >> n;
  vec.clear();
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0) sum += a[i];
    if (a[i] & 1) {
      if (a[i] < 0)
        vec.push_back(-a[i]);
      else
        vec.push_back(a[i]);
    }
  }
  if (sum & 1)
    cout << sum << endl;
  else {
    sort(vec.begin(), vec.end());
    sum -= vec[0];
    cout << sum << endl;
  }
  return 0;
}
