#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n;
  cin >> n;
  int i, j = 0, k = 0, num;
  for (i = 0; i < n; i++) {
    scanf("%d", &num);
    if (num % 2 == 0)
      a[j++] = num;
    else
      b[k++] = num;
  }
  sort(a, a + j, cmp);
  sort(b, b + k, cmp);
  long long int sum = 0;
  i = 0;
  while (a[i] > 0) sum += a[i++];
  int flag = 1;
  i = 0;
  while (b[i] > 0) i++;
  if (i == 0)
    printf("%lld", sum + b[0]);
  else if (i % 2 != 0) {
    j = 0;
    while (b[j] > 0) sum += b[j++];
    printf("%lld", sum);
  } else {
    j = 0;
    while (b[j] > 0) sum += b[j++];
    long long int sum1 = sum, sum2 = sum;
    sum1 += b[j];
    sum2 -= b[j - 1];
    if (sum1 % 2 == 0) sum1 = 0;
    if (sum2 % 2 == 0) sum2 = 0;
    sum = max(sum1, sum2);
    printf("%lld", sum);
  }
  return 0;
}
