#include <bits/stdc++.h>
using namespace std;
map<int, bool> in;
int main() {
  int n, mx = 0, arr[200], ans = 0;
  char a[200];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> arr[i];
    if (a[i] == '+') {
      in[arr[i]] = true;
      mx++;
    } else if (a[i] == '-') {
      if (in[arr[i]]) {
        mx--;
        in[arr[i]] = false;
      } else
        ans++;
    }
    ans = max(mx, ans);
  }
  cout << ans;
}
