#include <bits/stdc++.h>
using namespace std;
const int NN = 101100;
int a[NN];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  sort(a + 1, a + n + 1);
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] > 0) sum += a[i];
  }
  if (sum & 1) {
    cout << sum << endl;
    return 0;
  }
  auto id = upper_bound(a + 1, a + n + 1, 0) - a;
  while (id <= n && a[id] % 2 == 0) id++;
  if (id <= n) {
    int ed = a[id];
    id = lower_bound(a + 1, a + n + 1, 0) - a - 1;
    while (id > 0 && a[id] % 2 == 0) id--;
    if (id > 0) {
      int val = min(ed, abs(a[id]));
      sum -= val;
      cout << sum << endl;
      return 0;
    }
    sum -= ed;
    cout << sum << endl;
    return 0;
  }
  id = lower_bound(a + 1, a + n + 1, 0) - a - 1;
  while (id > 0 && a[id] % 2 == 0) id--;
  sum += a[id];
  cout << sum << endl;
  return 0;
}
