#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, co = 0, co2 = 0;
  cin >> n;
  map<int, bool> m;
  for (int i = 0; i < n; i++) {
    char c;
    int x;
    cin >> c >> x;
    if (c == '+') {
      m[x] = true;
      co++;
      co2 = max(co, co2);
    } else if (c == '-' && !m[x]) {
      co2++;
    } else if (c == '-' && m[x]) {
      co--;
    }
  }
  cout << co2;
}
