#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y = 0, z = 0;
  char c;
  bool p[1000005]{};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c >> x;
    if (c == '-') {
      if (p[x])
        p[x] = 0, z--;
      else
        y++;
    } else {
      p[x] = 1, z++;
    }
    y = max(y, z);
  }
  cout << y << "\n";
  return 0;
}
