#include <bits/stdc++.h>
using namespace std;
int n, ans;
bool a[1000100];
char s;
int main() {
  int i, x, now;
  now = 0;
  scanf("%d\n", &n);
  for (i = 1; i <= n; ++i) {
    scanf("%c %d\n", &s, &x);
    if (s == '+')
      ++now, a[x] = true;
    else if (a[x])
      --now, a[x] = false;
    else
      ++ans;
    if (now > ans) ans = now;
  }
  printf("%d", ans);
  return 0;
}
