#include <bits/stdc++.h>
using namespace std;
bool person[1000001];
int main() {
  int n, a;
  char c[2];
  cin >> n;
  int cur = 0, t = 0;
  while (n--) {
    cin >> c >> a;
    if (c[0] == '+') {
      cur++;
      person[a] = 1;
    } else {
      if (person[a] == 0) {
        t++;
      } else {
        cur--;
      }
      person[a] = 0;
    }
    t = max(cur, t);
  }
  cout << t;
}
