#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn], c[maxn];
int x = maxn;
int main() {
  int n, j = 0, sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2) c[j++] = a[i];
  }
  for (int i = 0; i < j; i++) x = min(x, abs(c[i]));
  for (int i = 0; i < n; i++)
    if (a[i] > 0) sum += a[i];
  if (sum % 2)
    cout << sum << endl;
  else
    cout << sum - x << endl;
  return 0;
}
