#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 7;
int n;
int a[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0) ans += a[i];
  }
  if (ans & 1)
    cout << ans << endl;
  else {
    int sum = ans;
    ans = -INF;
    for (int i = 0; i < n; i++) {
      if (a[i] < 0) a[i] = -a[i];
      if (a[i] & 1) ans = max(ans, sum - a[i]);
    }
    cout << ans << endl;
  }
  return 0;
}
