#include <bits/stdc++.h>
#pragma GCC optimize("-Ofast")
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  for (int i1 = 0; i1 < t; i1++) {
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) cin >> arr[i];
    sort(arr.begin(), arr.end());
    int sum = 0;
    int i;
    for (i = n - 1; i >= 0; i--) {
      if (arr[i] < 0) break;
      sum += arr[i];
    }
    int temi = i + 1;
    int tem1 = -INT_MAX, tem2 = -INT_MAX;
    if (sum % 2 == 0) {
      while (i >= 0) {
        if ((abs(sum + arr[i])) % 2 == 1) {
          tem1 = sum + arr[i];
          break;
        }
        i--;
      }
      i = temi;
      while (i < n) {
        if (abs(sum - arr[i]) % 2 == 1) {
          tem2 = sum - arr[i];
          break;
        }
        i++;
      }
      sum = max(tem1, tem2);
    }
    cout << sum;
  }
}
