#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010, INF = 10010;
int n, a[MAXN];
int main() {
  int Max = -INF, s = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > 0) s += a[i];
  }
  if (s == 0) {
    for (int i = 1; i <= n; i++)
      if (a[i] < 0 && a[i] > Max && abs(a[i]) & 1) Max = a[i];
    printf("%d\n", Max);
  } else if (s & 1)
    printf("%d\n", s);
  else {
    Max = INF;
    for (int i = 1; i <= n; i++)
      if (abs(a[i]) & 1) Max = min(Max, abs(a[i]));
    printf("%d\n", s - Max);
  }
  return 0;
}
