#include <bits/stdc++.h>
using namespace std;
const int cap = 1e6 + 5;
int main() {
  int j, n, i, x, ans = 0, ic = 0;
  cin >> n;
  vector<int> cc(n, 0);
  char c;
  vector<int> a(cap, -1);
  for (i = 0; i < n; i++) {
    cin >> c >> x;
    if (i) cc[i] = cc[i - 1];
    if (c == '-') {
      if (a[x] == -1) {
        ic++;
        for (j = i; j >= 0; --j) {
          cc[j]++;
        }
      }
      a[x] = 0;
      cc[i]--;
    } else {
      a[x] = 1;
      cc[i]++;
    }
  }
  cout << max(ic, *max_element((cc).begin(), (cc).end()));
  return 0;
}
