#include <bits/stdc++.h>
using namespace std;
int flag[1111111];
int n;
int main() {
  while (~scanf("%d", &n)) {
    char op[3];
    int tar;
    int now = 0, ans = 0;
    for (int i = 0; i < n; i++) {
      scanf("%s%d", op, &tar);
      if (op[0] == '+') {
        flag[tar] = 1;
        now++;
        ans = max(ans, now);
      } else if (op[0] == '-') {
        if (flag[tar]) {
          now--;
          flag[tar] = 0;
        } else
          ans++;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
