#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
int ans = 0;
int main() {
  int n, m, minn = maxn;
  cin >> n;
  while (n--) {
    cin >> m;
    if (m > 0) ans += m;
    if (minn > abs(m) && (abs(m) & 1)) minn = abs(m);
  }
  if (ans & 1)
    cout << ans << endl;
  else
    cout << ans - minn << endl;
  return 0;
}
