#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, x, mxnodd = -1e5, mipodd = 1e5, sum = 0;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    if (x < 0 and x & 1) mxnodd = max(mxnodd, x);
    if (x > 0 and x & 1) mipodd = min(mipodd, x);
    if (x > 0) sum += x;
  }
  if (sum % 2 == 0) sum -= min(mipodd, -mxnodd);
  cout << sum;
  return 0;
}
