#include <bits/stdc++.h>
int main() {
  int i, n, current = 0, maxx = 0, prev = 0, ar[1000];
  char sign;
  int ins;
  static int reg[1000009];
  for (i = 1; i < 1000009; i++) {
    reg[i] = 0;
  }
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    getchar();
    scanf("%c", &sign);
    scanf("%d", &ar[i]);
    if (sign == '-') {
      ar[i] *= -1;
    }
  }
  for (i = 1; i <= n; i++) {
    ins = ar[i];
    if (ins > 0) {
      current++;
      reg[ins]++;
    }
    if (ins < 0) {
      ins = -ins;
      if (reg[ins] != 0) {
        current--;
        reg[ins]--;
      } else {
        maxx++;
      }
    }
    if (current > maxx) {
      maxx = current;
    }
  }
  printf("%d", maxx);
  return 0;
}
