#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s = 0;
  int min_a1, min_a2;
  int fl1 = 0, fl2 = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (a % 2 == 1 && (fl1 == 0 || a <= min_a1)) {
      min_a1 = a;
      fl1 = 1;
    }
    if (a % 2 == -1 && (fl2 == 0 || (a >= min_a2))) {
      min_a2 = a;
      fl2 = 1;
    }
    if (a >= 0) s += a;
  }
  if (s % 2 == 0 && fl1 != 0 && fl2 != 0)
    s = max(s - min_a1, s + min_a2);
  else if (s % 2 == 0 && fl2 != 0)
    s += min_a2;
  else if (s % 2 == 0)
    s -= min_a1;
  cout << s;
  return 0;
}
