#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a < 0 || b < 0) return gcd(abs(a), abs(b));
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
template <class T>
T pwr(T b, T ar) {
  T r = 1, pr2 = b;
  while (ar) {
    if (ar & 1) r *= pr2;
    pr2 *= pr2;
    ar = (ar >> 1);
  }
  return r;
}
void remove(int a[], long pos, long &n) {}
int ar[101];
bool chk[1000001];
int main() {
  int n;
  cin >> n;
  int add = 0;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    char c;
    cin >> c;
    int qw;
    cin >> qw;
    if (c == '-' && chk[qw] == 0) {
      for (int j = 1; j <= i; j++) {
        ar[j]++;
      }
    } else if (c == '-' && chk[qw] == 1) {
      add--;
    } else {
      chk[qw] = 1;
      add++;
    }
    ar[i] += add;
  }
  for (int i = 1; i <= n; i++) {
    ans = max(ans, ar[i]);
  }
  cout << ans << endl;
  return 0;
}
