#include <bits/stdc++.h>
using namespace std;
bool arr[1000010];
int main() {
  int n;
  cin >> n;
  int cur = 0, mx = 0;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    int id;
    cin >> id;
    if (c == '+') {
      cur++;
      arr[id] = 1;
    } else {
      if (arr[id]) {
        cur--;
      } else
        mx++;
    }
    mx = max(mx, cur);
  }
  cout << mx;
  return 0;
}
