#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> make_pair;
  string s;
  int x;
  int count = 0, maxcnt = 0;
  int lastplus = 0;
  int prev = 1;
  for (int t = 1; t <= n; t++) {
    cin >> s;
    cin >> x;
    if (s[0] == '+') {
      count++;
      lastplus = count;
      make_pair[x] = 1;
      prev = 1;
      maxcnt = max(maxcnt, count);
    } else if (make_pair[x] == 1) {
      count--;
      make_pair[x] = 0;
    } else {
      maxcnt++;
    }
  }
  cout << maxcnt << endl;
  return 0;
}
