#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string inpt;
  char sign;
  int num;
  int Aplus[101];
  int Aminus[101];
  int k = 0, l = 0;
  int counter = 0, cntin = 0, cntout = 0, maybe = 0;
  int kmgwa = 0, tele3 = 0;
  bool flag = false;
  for (int i = 0; i < n; i++) {
    flag = false;
    cin >> sign;
    cin >> num;
    if (sign == '+') {
      Aplus[k++] = num;
      kmgwa++;
      if (tele3 > 0) {
        tele3--;
      }
      counter++;
    } else {
      Aminus[l++] = num;
      for (int j = 0; j < k; j++) {
        if (Aminus[l - 1] == Aplus[j]) {
          flag = true;
          kmgwa--;
          break;
        }
      }
      if (flag == false) {
        counter++;
      }
      tele3++;
    }
  }
  cout << tele3 + kmgwa;
  return 0;
}
