#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n;
  cin >> n;
  int maxsize = 0;
  while (n--) {
    char c;
    int k;
    cin >> c >> k;
    if (find(v.begin(), v.end(), k) != v.end()) {
      v.erase(find(v.begin(), v.end(), k));
      continue;
    } else if (c == '+')
      v.push_back(k);
    int size = v.size();
    if (c == '-') {
      size = maxsize;
      size++;
    }
    maxsize = max(maxsize, size);
  }
  cout << maxsize << endl;
}
