#include <bits/stdc++.h>
using namespace std;
int n, neg = -99999, num, idx = 0, res = 0;
int arr[100000];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &num);
    if (num > 0) {
      if (num % 2 == 0)
        res += num;
      else {
        arr[idx] = num;
        idx++;
      }
    } else {
      if ((num % 2 != 0) && (num > neg)) neg = num;
    }
  }
  if (idx == 0) {
    res += neg;
  } else if (idx % 2 != 0) {
    for (int i = 0; i < idx; i++) {
      res += arr[i];
    }
  } else {
    sort(arr, arr + idx);
    if (arr[0] > (-neg)) {
      for (int i = 0; i < idx; i++) {
        res += arr[i];
      }
      res += neg;
    } else {
      for (int i = 1; i < idx; i++) {
        res += arr[i];
      }
    }
  }
  printf("%d", res);
}
