#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
long long n, a[N], x, book, book2, ans;
long long cmp(long long a, long long b) { return a > b; }
int main() {
  book = ans = book2 = 0;
  scanf("%lld", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &x);
    if (x & 1) {
      if (x > 0) book2++;
      a[book++] = x;
    } else {
      if (x > 0) ans += x;
    }
  }
  sort(a, a + book, cmp);
  if (!book2)
    ans += a[0];
  else {
    if (book2 & 1) {
      for (int i = 0; i < book2; i++) {
        ans += a[i];
      }
    } else {
      for (int i = 0; i < book2 - 1; i++) {
        ans += a[i];
      }
      if ((ans + a[book2 - 1] + a[book2]) & 1)
        ans = max(ans, ans + a[book2 - 1] + a[book2]);
    }
  }
  printf("%lld\n", ans);
  return 0;
}
