#include <bits/stdc++.h>
int main(void) {
  int n;
  int i, i2;
  int a[100000] = {0};
  int flag = 0;
  int max = -1000001;
  int min = 1000001;
  int sum = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > 0) {
      if (a[i] < min && a[i] % 2 != 0) {
        min = a[i];
      }
      sum += a[i];
    } else {
      if (a[i] > max && a[i] % 2 != 0) {
        max = a[i];
      }
    }
  }
  if (min == 1000001) {
    printf("%d", sum + max);
    return 0;
  }
  if (sum % 2 == 0) {
    if (min > (-max)) {
      printf("%d", sum + max);
    } else {
      printf("%d", sum - min);
    }
  } else {
    printf("%d", sum);
  }
  return 0;
}
