#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> all;
  int ev[101];
  memset(ev, 0, sizeof(ev));
  int n;
  cin >> n;
  int current = 0;
  for (int i = 0; i < n; i++) {
    char c;
    int tmp;
    cin >> c >> tmp;
    if (c == '+')
      all[tmp]++, current++, ev[i] = current;
    else if (all.find(tmp) == all.end())
      for (int j = 0; j <= i; j++) ev[j]++;
    else
      all[tmp]--, current--;
  }
  int maxE = 0;
  for (int i = 0; i < n; i++) maxE = max(maxE, ev[i]);
  cout << maxE << endl;
}
