#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int row;
  while (~scanf("%d", &row)) {
    int id[row], gap = 0, count = 0;
    char ch[row][1];
    bool mark[1000000 + 1];
    for (int i = 1; i <= 1000000; i++) mark[i] = false;
    for (int i = 0; i < row; i++) {
      scanf("%s%d", &ch[i], &id[i]);
    }
    for (int i = 0; i < row; i++) {
      int value = id[i];
      if (ch[i][0] == '+') {
        if (!mark[value]) mark[value] = true;
        if (gap == 0) {
          count++;
        } else
          gap--;
      } else {
        if (!mark[value]) {
          count++;
          gap++;
        } else
          gap++;
      }
    }
    printf("%d\n", count);
  }
  return 0;
}
