#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int a[maxn];
int maxf = -2000000000, minz = 2000000000;
int main() {
  int n, ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > 0 && a[i] < minz && a[i] % 2 == 1) minz = a[i];
    if (a[i] < 0 && a[i] > maxf && -a[i] % 2 == 1) maxf = a[i];
    if (a[i] > 0) ans += a[i];
  }
  if (ans % 2) {
    cout << ans;
    return 0;
  }
  if (minz == 2000000000)
    cout << ans + maxf;
  else if (maxf == -2000000000)
    cout << ans - minz;
  else
    cout << max(ans + maxf, ans - minz);
  return 0;
}
