#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
int n, a[maxn], javab = 0;
vector<int> v;
int main() {
  int x;
  char y;
  a[0] = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> y >> x;
    if (y == '+') {
      v.push_back(x);
      a[i] = a[i - 1] + 1;
    } else if (y == '-') {
      if ((int)v.size() == 0) {
        for (int j = 0; j < i; j++) a[j]++;
        a[i] = a[i - 1] - 1;
        continue;
      }
      for (int j = 0; j < (int)v.size(); j++) {
        if (v[j] == x) {
          v[j] = -1;
          break;
        } else if (j == (int)v.size() - 1) {
          for (int s = 0; s < i; s++) a[s]++;
          break;
        }
      }
      a[i] = a[i - 1] - 1;
    }
  }
  for (int i = 0; i <= n; i++) javab = max(javab, a[i]);
  cout << javab << endl;
  return 0;
}
