#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, i;
  long long int x, even, max_odd, sum, best, min_neg;
  scanf("%ld", &n);
  vector<long long int> v;
  max_odd = 0;
  even = 0;
  min_neg = 0;
  for (i = 0; i < n; i++) {
    scanf("%lld", &x);
    if (x % 2 != 0 && x > 0) v.push_back(x);
    if (min_neg == 0 && x < 0 && x % 2 != 0)
      min_neg = x;
    else if (x < 0 && x % 2 != 0 && min_neg < x)
      min_neg = x;
    if (x % 2 == 0 && x > 0)
      even += x;
    else if (max_odd == 0 && x % 2 != 0)
      max_odd = x;
    else if (max_odd < x && x % 2 != 0)
      max_odd = x;
  }
  sort(v.begin(), v.end());
  long long int total_odd = 0;
  if (v.size() % 2 == 0) {
    if (v.size() > 0 && min_neg && min_neg + v.at(0) >= 0) {
      i = 0;
      total_odd = min_neg;
    } else {
      i = 1;
    }
  } else {
    i = 0;
  }
  for (; i < v.size(); i++) {
    total_odd += v.at(i);
  }
  if (max_odd > 0) {
    sum = total_odd + even;
  } else {
    sum = max_odd + even;
  }
  printf("%lld\n", sum);
}
