#include <bits/stdc++.h>
using namespace std;
int input[1000001] = {0};
void solve() {
  int n;
  scanf("%d", &n);
  int plu = 0, minu = 0;
  int mi = 0, room = 0;
  int in[n];
  for (int i = 0; i < n; i++) {
    char in1[2];
    scanf("%s %d", &in1, &in[i]);
    if (in1[0] == '+') {
      input[in[i]] = 1;
    } else if (in1[0] == '-') {
      if (input[in[i]] != 1) {
        room++;
        in[i] = -1 * in[i];
      } else {
        input[in[i]] = 0;
        in[i] = -1 * in[i];
      }
    }
  }
  mi = room;
  int ans = room;
  for (int i = 0; i < n; i++) {
    if (in[i] > 0) {
      mi++;
    } else {
      mi--;
    }
    if (ans < mi) {
      ans = mi;
    }
  }
  printf("%d\n", ans);
}
int main() {
  solve();
  return 0;
}
