#include <bits/stdc++.h>
using namespace std;
bool arr[1000010];
int main() {
  int n;
  scanf("%d", &n);
  int ar[n];
  for (int i = 0; i <= 1000000; i++) arr[i] = false;
  int cur = 0;
  int ma = 0;
  char ch;
  int m;
  for (int i = 0; i < n; i++) {
    scanf(" %c %d", &ch, &m);
    if (ch == '+') {
      arr[m] = true;
      cur++;
      ma = max(ma, cur);
    } else {
      if (arr[m] == true) {
        arr[m] = false;
        cur--;
      } else {
        ma++;
        arr[m] = false;
      }
    }
  }
  printf("%d\n", ma);
  return 0;
}
