#include <bits/stdc++.h>
using namespace std;
int n;
int num[200];
int main() {
  scanf("%d", &n);
  char str[2];
  set<int> s;
  int cnt = 0;
  int maxn = 0;
  for (int i = 0; i < n; i++) {
    scanf("%s%d", str, &num[i]);
    if (str[0] == '+') {
      s.insert(num[i]);
      int sz = s.size();
      maxn = max(maxn, sz);
    } else {
      if (s.find(num[i]) == s.end()) {
        maxn++;
      } else {
        s.erase(num[i]);
      }
      maxn = max(maxn, cnt);
    }
  }
  s.clear();
  printf("%d\n", maxn);
  return 0;
}
