#include <bits/stdc++.h>
using namespace std;
int main() {
  int counter = 0, mx = 0, num, n;
  map<int, bool> mp;
  char pos;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pos >> num;
    if (pos == '+') {
      mp[num] = true;
      counter++;
    } else {
      if (mp[num]) {
        mp[num] = false;
        counter--;
      } else
        mx++;
    }
    mx = max(mx, counter);
  }
  cout << mx;
}
