#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int *arr = new int[n];
  int ans = 0, temp1 = INT_MAX, temp2 = INT_MIN;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] > 0) ans += arr[i];
    if (arr[i] > 0 && arr[i] % 2 != 0) temp1 = min(temp1, arr[i]);
    if (arr[i] < 0 && arr[i] % 2 != 0) temp2 = max(temp2, arr[i]);
  }
  if (ans % 2 != 0)
    cout << ans << endl;
  else
    cout << max(ans - temp1, ans + temp2) << endl;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
