#include <bits/stdc++.h>
int a[110], b[1000010] = {0};
int main() {
  int n, y, count = 0, max = 0;
  char x;
  scanf("%d", &n);
  while (n--) {
    scanf(" %c%d", &x, &y);
    if (x == '+')
      count++, b[y] = 1, max = max > count ? max : count;
    else {
      if (b[y])
        count--, b[y] = 0;
      else
        max++;
    }
  }
  printf("%d\n", max);
  return 0;
}
