#include <bits/stdc++.h>
using namespace std;
int n, mrs[1000005], hasStarted[1000005], isFinished[1000005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    char op;
    int nr;
    cin >> op >> nr;
    if (op == '+') {
      ++mrs[i];
      hasStarted[nr] = 1;
    } else {
      --mrs[i + 1];
      if (!hasStarted[nr]) ++mrs[0];
      isFinished[nr] = 1;
    }
  }
  int sm = 0, re = 0;
  for (int i = 0; i < 1000005; ++i) {
    sm += mrs[i];
    re = max(re, sm);
  }
  cout << re;
  return 0;
}
