#include <bits/stdc++.h>
using namespace std;
bool flag[1000005];
int n;
int s[1000005];
char dau[2];
int num;
void input() {
  for (int i = 0; i <= n; i++) s[i] = 0;
  for (int i = 0; i <= 1000000; i++) flag[i] = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%s %d", &dau, &num);
    if (dau[0] == '+') {
      s[i]++;
      flag[num] = 1;
    } else {
      if (flag[num] == 1) {
        flag[num] = 0;
        s[i]--;
      } else {
        s[0]++;
        s[i]--;
      }
    }
  }
}
void solve() {
  int ans = 0;
  for (int i = 0; i <= n; i++) {
    if (i > 0) s[i] += s[i - 1];
    ans = max(ans, s[i]);
  }
  printf("%d\n", ans);
}
int main() {
  while (scanf("%d", &n) > 0) {
    input();
    solve();
  }
  return 0;
}
