#include <bits/stdc++.h>
using namespace std;
long long n, i, a, A, mn, mx;
int main() {
  cin >> n;
  for (i = 1, mn = LLONG_MAX, mx = -LLONG_MAX; i <= n; i++) {
    cin >> a;
    if (a % 2 and a > 0) {
      A += a;
      mn = min(mn, a);
    } else if (a % 2 and a < 0)
      mx = max(mx, a);
    else if (a > 0)
      A += a;
  }
  if (A % 2 == 0) A -= min(mn, -mx);
  cout << A << "\n";
}
