#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
int a[100005];
int n;
int solve() {
  sort(a, a + n);
  int i = n - 1;
  int sum = 0;
  while (i >= 0 and a[i] >= 0) sum += a[i--];
  if (sum % 2) return sum;
  int j = i;
  while (j >= 0 and abs(a[j]) % 2 == 0) j--;
  i++;
  while (i < n and a[i] % 2 == 0) i++;
  if (j < 0) return sum - a[i];
  if (i == n) return sum + a[j];
  return sum - min(a[i], abs(a[j]));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t) {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    cout << solve();
    t--;
  }
  return 0;
}
