#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  long long int n;
  while (t--) {
    cin >> n;
    long long int arr[n];
    for (long long int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    long long int min_odd = LLONG_MAX;
    bool isOdd = false;
    long long int sum = 0;
    for (long long int i = 0; i < n; i++) {
      if (arr[i] > 0) {
        sum += arr[i];
      }
      if (arr[i] & 1) {
        isOdd = true;
        min_odd = min(min_odd, abs(arr[i]));
      }
    }
    if (!isOdd)
      cout << "-1\n";
    else {
      if (sum % 2 == 0) sum -= min_odd;
      cout << sum << "\n";
    }
  }
  return 0;
}
