#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  int N;
  cin >> N;
  pair<char, int> list[N];
  for (int i = 0; i < N; i++) cin >> list[i].first >> list[i].second;
  int initial = 0;
  set<int> presents;
  for (int i = 0; i < N; i++) {
    int count = 0;
    char sign = list[i].first;
    int id = list[i].second;
    if (sign == '+') {
      presents.insert(id);
    } else if (sign == '-') {
      if (presents.count(id)) {
        presents.erase(id);
      } else
        initial++;
    } else
      assert(false);
  }
  presents.clear();
  int maxi = initial;
  int count = initial;
  for (int i = 0; i < N; i++) {
    char sign = list[i].first;
    int id = list[i].second;
    if (sign == '+') {
      count++;
      presents.insert(id);
    } else if (sign == '-') {
      count--;
      if (presents.count(id)) presents.erase(id);
    }
    maxi = max(maxi, count);
  }
  cout << maxi << endl;
}
