#include <bits/stdc++.h>
long long A[100000];
using namespace std;
int main() {
  long long n, s = 0, m = -100000, a = 0, p;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    if (A[i] % 2 == 0 && A[i] > 0) s += A[i];
  }
  std::sort(A, A + n);
  for (int i = n - 1; i >= 0; i--) {
    if (A[i] % 2 != 0 && (A[i] > 0 || (A[i] < 0 && a == 0) ||
                          (A[i] < 0 && a % 2 == 0 && A[i] + p > 0))) {
      a++;
      p = A[i];
      s += p;
    }
  }
  if (a % 2 == 0) s -= p;
  cout << s;
}
