#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, t, sum = 0, max1 = 0, temp = 0;
  char ch;
  set<int> a, b;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> ch >> t;
    if (ch == '+') {
      a.insert(t);
      max1 = max1 > a.size() ? max1 : a.size();
      temp = temp > a.size() ? temp : a.size();
    } else if (ch == '-') {
      if (a.find(t) == a.end()) {
        temp++;
        max1 = temp > max1 ? temp : max1;
      } else {
        a.erase(t);
      }
    }
  }
  cout << max1 << endl;
  return 0;
}
