#include <bits/stdc++.h>
using namespace std;
vector<int> readers;
int ans[105];
int check(int x) {
  for (int i = 0; i < readers.size(); i++)
    if (readers[i] == x) {
      readers.erase(readers.begin() + i);
      return 1;
    }
  return 0;
}
int main() {
  int N, cur, num, maxx, prog;
  char c;
  cin >> N;
  maxx = 0;
  for (int i = 0; i < N; i++) {
    cin >> c >> num;
    if (c == '+') {
      readers.push_back(num);
    } else {
      if (check(num) == 0) {
        for (int j = 0; j <= i; j++) ans[j]++;
      }
    }
    ans[i] += readers.size();
  }
  for (int i = 0; i < N; i++) maxx = max(maxx, ans[i]);
  cout << maxx << endl;
  return 0;
}
