#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j = 0, k, a[1000005] = {0}, b = 0, ans = 0;
  char c[2];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> c >> k;
    if (c[0] == '+') {
      a[k] = 1;
      b++;
      j = max(j, b);
    } else if (a[k]) {
      a[k] = 0;
      b--;
    } else {
      ans++;
      b--;
    }
  }
  cout << ans + j;
  return 0;
}
