#include <bits/stdc++.h>
using namespace std;
long long mark[1000005];
int main() {
  long long n, left = 0, cnt = 0;
  cin >> n;
  while (n--) {
    char ch;
    long long num;
    cin >> ch >> num;
    if (ch == '+') {
      mark[num] = 1;
      left++;
      if (cnt < left) cnt = left;
    } else {
      if (mark[num])
        left--;
      else
        cnt++;
      mark[num] = 0;
    }
  }
  cout << cnt << endl;
  return 0;
}
