#include <bits/stdc++.h>
using namespace std;
int r[1000050];
int main() {
  int n, b, sum, ans;
  char a[5];
  while (scanf("%d", &n) != EOF) {
    ans = 0;
    sum = 0;
    memset(r, 0, sizeof(r));
    for (int i = 0; i < n; i++) {
      scanf("%s %d", a, &b);
      if (a[0] == '+') {
        sum++;
        r[b]++;
      } else {
        if (!r[b])
          ans++;
        else {
          sum--;
          r[b]--;
        }
      }
      ans = max(sum, ans);
    }
    printf("%d\n", ans);
  }
  return 0;
}
