#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  set<int> people;
  int result = 0;
  int curPeople = 0;
  for (int i = 0; i < n; i++) {
    char type;
    int id;
    scanf("\n%c %d", &type, &id);
    if (type == '+') {
      people.insert(id);
      curPeople++;
      result = max(result, curPeople);
    }
    if (type == '-') {
      if (people.find(id) != people.end()) {
        people.erase(people.find(id));
        curPeople--;
      } else {
        result++;
      }
    }
  }
  printf("%d", result);
}
