#include <bits/stdc++.h>
using namespace std;
int a[100005];
set<int> jin;
int main() {
  int n, m, last = 0;
  char r;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> r >> m;
    if (r == '+') {
      jin.insert(m);
      int now = jin.size();
      last = max(now, last);
    }
    if (r == '-') {
      if (jin.find(m) == jin.end())
        last++;
      else
        jin.erase(m);
      int j = jin.size();
      last = max(last, j);
    }
  }
  printf("%d\n", last);
  return 0;
}
