#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, ans;
  set<int> a;
  char s[10];
  scanf("%d", &n);
  ans = 0;
  while (n--) {
    scanf("%s%d", s, &m);
    if (s[0] == '+')
      a.insert(m);
    else if (a.count(m))
      a.erase(m);
    else
      ans++;
    ans = a.size() > ans ? a.size() : ans;
  }
  printf("%d\n", ans);
  return 0;
}
