#include <bits/stdc++.h>
using namespace std;
const int base = 100000;
const int N = 1e5 + 18;
int n;
int oddmax, oddmin;
int ans;
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  oddmin = 12345678;
  oddmax = -98765432;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    if (x > 0) ans += x;
    if (x > 0 && x % 2 == 1) oddmin = min(oddmin, x);
    if (x < 0 && (x + base) % 2 == 1) oddmax = max(oddmax, x);
  }
  cout << ((ans % 2 == 1) ? ans : max(ans - oddmin, ans + oddmax));
  return 0;
}
