#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int& i : v) {
    cin >> i;
  }
  sort(v.rbegin(), v.rend());
  int sum = 0;
  int best_sum = INT32_MIN;
  int smaller_odd = INT32_MAX;
  for (int& i : v) {
    if (i % 2 != 0) {
      sum += i;
      smaller_odd = min(smaller_odd, i);
    } else if (i > 0) {
      sum += i;
    }
    if (sum % 2 != 0) {
      best_sum = max(best_sum, sum);
    } else {
      best_sum = max(best_sum, sum - smaller_odd);
    }
  }
  cout << best_sum << endl;
  return 0;
}
