#include <bits/stdc++.h>
using namespace std;
int n;
char s[100][2];
int hash_[1000005];
int main() {
  scanf("%d", &n);
  int cap = 0;
  int left = 0;
  memset(hash_, 0, sizeof(hash_));
  for (int i = 0; i < n; i++) {
    int val;
    scanf("%s", s[i]);
    scanf("%d", &val);
    if (s[i][0] == '+') {
      if (hash_[val] == 0) {
        hash_[val]++;
        if (left == 0) {
          cap++;
        } else {
          left--;
        }
      }
    } else if (s[i][0] == '-') {
      if (hash_[val] == 0) {
        left++;
        cap++;
      } else {
        hash_[val]--;
        left++;
      }
    }
  }
  printf("%d\n", cap);
  return 0;
}
