#include <bits/stdc++.h>
using namespace std;
int bj[1000001];
int main() {
  int i, n;
  char m;
  int now = 0, room = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    int u;
    scanf(" %c", &m);
    scanf("%d", &u);
    if (m == '+') {
      now++;
      bj[u] = 1;
    }
    if (m == '-') {
      if (bj[u] == 1) {
        now--;
        bj[u] == 0;
      } else
        room++;
    }
    if (now > room) room = now;
  }
  printf("%d\n", room);
}
