#include <bits/stdc++.h>
using namespace std;
template <typename T>
void println(T x) {
  cout << x << endl;
}
template <typename T>
void print(T x) {
  cout << x;
}
template <typename Container>
void printvec(const Container& cont) {
  for (auto const& x : cont) {
    cout << x << " ";
  }
  std::cout << "\n";
}
template <typename T>
void printList(std::initializer_list<T> text) {
  for (const auto& value : text) std::cout << value << " ";
}
vector<int> slicing(vector<int>& arr, int X, int Y) {
  auto start = arr.begin() + X;
  auto end = arr.begin() + Y + 1;
  vector<int> result(Y - X + 1);
  copy(start, end, result.begin());
  return result;
}
void Solve() {
  long long int n;
  cin >> n;
  long long int ans = 0, oddcnt = 0, minodd = INT_MAX, negodd = INT_MIN;
  for (int i = 0; i < n; i++) {
    long long int tmp;
    cin >> tmp;
    if (tmp > 0) {
      ans += tmp;
      if (tmp & 1) {
        oddcnt++;
        minodd = min(minodd, tmp);
      }
    } else {
      if (tmp & 1) negodd = max(negodd, tmp);
    }
  }
  if (oddcnt & 1) {
    cout << ans << endl;
  } else {
    if (negodd != INT_MIN && minodd != INT_MAX)
      cout << max(ans - minodd, ans + negodd) << endl;
    else if (negodd == INT_MIN)
      cout << ans - minodd << endl;
    else
      cout << ans + negodd << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int testcases = 1;
  while (testcases--) {
    Solve();
  }
  return 0;
}
