#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n;
  cin >> n;
  set<int> s, v;
  char ar[n];
  int br[n];
  for (int i = 0; i < n; i++) {
    cin >> ar[i] >> br[i];
    if (ar[i] == '+') {
      s.insert(br[i]);
    } else {
      if (!s.count(br[i])) {
        v.insert(br[i]);
      }
    }
  }
  int ans = v.size();
  int c = ans;
  for (int i = 0; i < n; i++) {
    if (ar[i] == '+') {
      c++;
    } else {
      c--;
    }
    ans = max(ans, c);
  }
  cout << ans << endl;
}
