#include <bits/stdc++.h>
using namespace std;
bool arr[1000005] = {false};
int main() {
  long long n;
  cin >> n;
  long long ans = 0, temp = 0;
  for (long long lv = 0; lv < n; lv++) {
    char ch;
    long long num;
    cin >> ch >> num;
    if (ch == '+') {
      ans++;
      temp = max(temp, ans);
      arr[num] = true;
    } else {
      if (arr[num]) {
        arr[num] = false;
        ans--;
      } else {
        temp++;
      }
    }
  }
  cout << temp << endl;
  return 0;
}
