#include <bits/stdc++.h>
using namespace std;
int arr[1000000];
int main() {
  int n;
  cin >> n;
  int mini = 2e9, sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] > 0) sum += arr[i];
    if (arr[i] % 2 == 1 || arr[i] % 2 == -1) {
      int l = abs(arr[i]);
      mini = min(mini, l);
    }
  }
  if (sum % 2 == 0)
    cout << sum - mini;
  else
    cout << sum;
  return 0;
}
