#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long N;
  cin >> N;
  long long sum = 0;
  long long smallestPositiveOddElement = INT_MAX;
  long long largestNegativeOddElement = INT_MIN;
  long long array[N];
  for (auto(i) = 0; i < N; i++) {
    cin >> array[i];
    if (array[i] >= 0) sum += array[i];
    if (array[i] >= 0 && array[i] % 2 != 0)
      smallestPositiveOddElement = min(smallestPositiveOddElement, array[i]);
    if (array[i] < 0 && array[i] % 2 != 0)
      largestNegativeOddElement = max(largestNegativeOddElement, array[i]);
  }
  if (sum % 2 != 0)
    cout << sum;
  else
    cout << max(sum + largestNegativeOddElement,
                sum - smallestPositiveOddElement);
  return 0;
}
