#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end(), greater<int>());
  int s = 0, ans = -INT_MAX;
  for (int i = 0; i < n; i++) {
    if (!(a[i] & 1)) {
      s = s + a[i];
      ans = max(ans, s);
      if (s < ans) s = 0;
    }
  }
  s = ans;
  if (s < 0) s = ans = 0;
  bool done = false;
  for (int i = 0; i < n; i++) {
    if (a[i] & 1) {
      s = s + a[i];
      if (!done) {
        done = true;
        ans = s;
      }
    }
    if (s & 1) {
      ans = max(ans, s);
      if (s < ans) s = 0;
    }
  }
  cout << ans << "\n";
}
