#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k = 0, l = 0;
  cin >> n;
  int pos[100000], neg[100000];
  for (i = 0; i < n; i++) {
    cin >> j;
    if (j >= 0)
      pos[k] = j, k++;
    else
      neg[l] = -j, l++;
  }
  int sum = 0;
  for (i = 0; i < k; i++) sum += pos[i];
  sort(pos, pos + k);
  sort(neg, neg + l);
  int m1, m2;
  m1 = m2 = INT_MAX;
  for (i = 0; i < k; i++) {
    if (pos[i] % 2 != 0) {
      m1 = pos[i];
      break;
    }
  }
  for (i = 0; i < l; i++) {
    if (neg[i] % 2 != 0) {
      m2 = neg[i];
      break;
    }
  }
  m1 = min(m1, m2);
  if (sum % 2 == 0) sum -= m1;
  cout << sum;
  return 0;
}
