#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  set<int> s;
  set<int>::iterator it;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    char ch[2];
    int a;
    scanf("%s %d", ch, &a);
    if (ch[0] == '+') {
      s.insert(a);
      ans = max(ans, (int)s.size());
    } else {
      it = s.find(a);
      if (it != s.end())
        s.erase(it);
      else
        ans++;
    }
  }
  printf("%d\n", ans);
}
