#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, flag = 0, sum = 0, max = -1000000000, sum2 = 0,
                   min = 1000000000, max2 = -1000000000;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0) {
      sum = sum + a[i];
      if (a[i] < min && a[i] % 2 != 0) {
        min = a[i];
      }
      flag = 1;
    }
    if (a[i] < 0) {
      sum2 = sum2 + a[i];
      if (a[i] > max2 && a[i] % 2 != 0) {
        max2 = a[i];
      }
    }
  }
  if (flag == 0) {
    cout << max2;
  }
  if (flag == 1) {
    if (sum % 2 != 0) {
      cout << sum;
    } else {
      if (min != 1000000000) {
        if (min < -1 * (max2)) {
          cout << sum - min;
        } else {
          cout << sum + max2;
        }
      } else {
        cout << sum + max2;
      }
    }
  }
  return 0;
}
