#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, visitor;
  char state;
  int Max = 0, curr = 0;
  map<int, char> arr;
  int def = 0;
  vector<pair<int, char> > log;
  cin >> num;
  for (int i = 0; i < num; ++i) {
    cin >> state >> visitor;
    log.push_back(make_pair(visitor, state));
    if (arr.find(visitor) == arr.end()) {
      if (state == '+')
        arr.insert(make_pair(visitor, state));
      else
        def++;
    }
    Max = def;
    curr = def;
    for (int j = 0; j < log.size(); ++j) {
      if (arr.find(log[j].first) == arr.end()) {
        curr--;
      } else if (log[j].second == '+') {
        curr++;
      } else if (log[j].second == '-') {
        curr--;
      }
      if (curr > Max) {
        Max = curr;
      }
    }
  }
  cout << Max << endl;
  return 0;
}
