#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, sum = 0, q, x = 100000, y = -100000;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> q;
    if (q >= 0) sum += q;
    if (q > 0 && q % 2 != 0) x = min(x, q);
    if (q < 0 && q % 2 != 0) y = max(y, q);
  }
  if (sum % 2 != 0)
    cout << sum << endl;
  else {
    x = min(x, abs(y));
    cout << sum - x << endl;
  }
  return 0;
}
