#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  long long n;
  cin >> n;
  set<long long> second;
  long long maxm = 0;
  for (long long i = 0; i < n; i++) {
    char c;
    cin >> c;
    long long a;
    cin >> a;
    if (c == '+') {
      second.insert(a);
      long long num = second.size();
      maxm = max(maxm, num);
    } else {
      if (second.find(a) != second.end()) {
        second.erase(a);
      } else
        maxm += 1;
    }
  }
  cout << maxm << "\n";
}
