#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  char c;
  set<int> s;
  cin >> n;
  bool us[1000001] = {};
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> c >> q;
    if (c == '+') {
      us[q] = true;
      s.insert(q);
    }
    if (c == '-' && us[q]) {
      s.erase(q);
    }
    if (c == '-' && !us[q]) {
      ans += 1;
      us[q] = true;
    }
    ans = ((ans > (int)s.size()) ? (ans) : ((int)s.size()));
  }
  cout << ans;
  return 0;
}
