#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ri, cur = 0, maxcur = 0;
  char ch;
  bool a[1000006];
  memset(a, false, sizeof a);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ch >> ri;
    if (ch == '+') {
      cur++;
      a[ri] = true;
    } else {
      if (a[ri]) {
        cur--;
        a[ri] = false;
      } else
        maxcur++;
    }
    maxcur = max(cur, maxcur);
  }
  cout << maxcur;
  return 0;
}
