#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  set<int> s[101];
  int extra = 0;
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    s[i] = s[i - 1];
    char ch;
    int id;
    cin >> ch >> id;
    if (ch == '+') {
      s[i].insert(id);
    } else {
      if (s[i].find(id) == s[i].end()) {
        for (int j = 0; j < i; j++) s[j].insert(id);
      } else {
        s[i].erase(id);
      }
    }
  }
  for (int i = 0; i <= n; i++) mx = max(mx, (int)(s[i].size()));
  cout << mx << endl;
  return 0;
}
