#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  n += 100;
  int data[220];
  bool f[1000005];
  memset(f, 0, sizeof f);
  char tanda[220];
  int min = 100;
  for (int i = 100; i < n; i++) {
    string t;
    int ind;
    cin >> t >> ind;
    if (t[0] == '+') {
      tanda[i] = '+';
      data[i] = ind;
      f[ind] = 1;
    } else {
      if (f[ind]) {
        tanda[i] = '-';
        data[i] = ind;
        f[ind] = 0;
      } else {
        min--;
        tanda[min] = '+';
        data[min] = ind;
        tanda[i] = '-';
        data[i] = ind;
      }
    }
  }
  int maks = 0, c = 0;
  for (int i = min; i < n; i++) {
    if (tanda[i] == '+') {
      c++;
      if (c > maks) maks = c;
    } else
      c--;
  }
  cout << maks << endl;
  return 0;
}
