#include <bits/stdc++.h>
using namespace std;
int n, vis[1000005], num, sum1 = 0, sum2 = 0;
int main() {
  char c;
  memset(vis, 0, sizeof(vis));
  scanf("%d", &n);
  getchar();
  while (n--) {
    scanf("%c%d", &c, &num);
    getchar();
    if (c == '+') {
      sum1++;
      vis[num] = 1;
      sum2 = max(sum1, sum2);
    } else {
      if (vis[num] == 0) {
        sum2++;
      } else {
        vis[num] = 0;
        sum1--;
      }
    }
  }
  printf("%d\n", sum2);
  return 0;
}
