#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n), x;
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  int sum = 0;
  for (int i = 0; i < n; i++) {
    if (v[i] >= 0 && v[i] % 2 == 0)
      sum += v[i];
    else if (v[i] % 2)
      x.push_back(v[i]);
  }
  sort(x.begin(), x.end());
  reverse(x.begin(), x.end());
  if (x.size() == 0) return cout << 0, 0;
  sum += x[0];
  for (int i = 1; i < x.size() - 1; i += 2) {
    if (x[i] + x[i + 1] > 0) sum += x[i] + x[i + 1];
  }
  cout << sum << endl;
  return 0;
}
