#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char vi[1000001] = {0};
  char tp;
  int in;
  int mx = 0;
  int cur = 0;
  while (n--) {
    cin >> tp >> in;
    if (tp == '+') {
      vi[in] = 1;
      cur++;
      if (cur > mx) mx = cur;
    } else {
      if (vi[in] == 0)
        mx++;
      else {
        vi[in] = 0;
        cur--;
      }
    }
  }
  cout << mx;
  return 0;
}
