#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0, sch = 0, nm = -100000, pnm = 10000;
  vector<int> v;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    if ((t % 2 == 1) && (t > 0)) {
      pnm = ((pnm) < (t)) ? (pnm) : (t);
      ans += t;
    } else if (t % 2 == -1) {
      nm = ((nm) > (t)) ? (nm) : (t);
    } else if (t > 0) {
      sch += t;
    }
  }
  if (ans == 0) ans += nm;
  ans += sch;
  if (ans % 2 == 0) ans = ((ans - pnm) > (ans + nm)) ? (ans - pnm) : (ans + nm);
  printf("%d", ans);
  return 0;
}
