#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  long long mnOdd = INT_MAX, mxOdd = INT_MIN;
  long long evSum = 0, odSum = 0;
  long long x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    arr[i] = x;
    if (x % 2 != 0) {
      mnOdd = min(mnOdd, x);
      mxOdd = max(mxOdd, x);
    }
    if (x > 0) {
      if (x % 2 == 0) {
        evSum += x;
      } else {
        odSum += x;
      }
    }
  }
  long long ans = 0;
  if (odSum == 0) {
    ans = evSum + mxOdd;
  } else {
    if (odSum % 2 != 0) {
      ans = evSum + odSum;
    } else {
      ans = evSum + odSum;
      int a = INT_MIN;
      int b = INT_MAX;
      for (int i = 0; i < n; i++) {
        if (arr[i] % 2 != 0 && arr[i] < 0) {
          a = max(a, arr[i]);
        } else if (arr[i] % 2 != 0 && arr[i] > 0) {
          b = min(b, arr[i]);
        }
      }
      ans = max(ans + a, ans - b);
    }
  }
  cout << ans;
  return 0;
}
