#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tests = 1;
  while (tests--) {
    int n;
    cin >> n;
    vector<int> a(n), even, odd, neven, nodd;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] >= 0 && a[i] % 2 == 0) even.push_back(a[i]);
      if (a[i] >= 0 && a[i] % 2 != 0) odd.push_back(a[i]);
      if (a[i] < 0 && a[i] % 2 == 0) neven.push_back(a[i]);
      if (a[i] < 0 && a[i] % 2 != 0) nodd.push_back(a[i]);
    }
    sort((even).begin(), (even).end());
    sort((odd).begin(), (odd).end());
    sort((nodd).begin(), (nodd).end());
    reverse((nodd).begin(), (nodd).end());
    sort((neven).begin(), (neven).end());
    int oddsum = accumulate((odd).begin(), (odd).end(), 0);
    int evensum = accumulate((even).begin(), (even).end(), 0);
    int totalsum = (oddsum + evensum);
    if (totalsum % 2 != 0) {
      cout << totalsum;
      return 0;
    } else {
      long long c = -1000000004;
      long long d = -1000000004;
      if (odd.size() > 0) c = totalsum - odd[0];
      if (nodd.size() > 0) d = totalsum + nodd[0];
      int totalsum1 = (c) >= (d) ? c : d;
      cout << totalsum1;
      return 0;
    }
  }
}
