#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  vector<long long> o;
  long long ans = 0;
  long long k = 100000000;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    if (x > 0) ans += x;
    if (x % 2) k = min(k, abs(x));
  }
  cout << (ans % 2 ? ans : ans - k);
}
