#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
inline void read(int &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = 10 * x + c - '0';
    c = getchar();
  }
  x *= f;
}
void printDouble(double x, int n) {
  cout << fixed << setprecision(n);
  cout << x << endl;
}
int main() {
  int n, res(0), x, sEven(0), sOdd(0);
  cin >> n;
  vector<int> odd;
  for (int i = 1; i <= n; i++) {
    read(x);
    if (abs(x) % 2 == 0)
      sEven += x > 0 ? x : 0;
    else
      odd.emplace_back(x);
  }
  sort(odd.rbegin(), odd.rend());
  int i = 0;
  while (i <= ((int)((odd).size())) - 1 && odd[i] > 0) {
    sOdd += odd[i];
    i++;
  }
  if (sOdd == 0)
    res = sEven + odd[0];
  else if ((sEven + sOdd) % 2 == 0)
    res = sEven + sOdd - min(abs(odd[i]), odd[i - 1]);
  else
    res = sEven + sOdd;
  cout << res;
}
