#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<char> c(n);
  vector<int> id(n);
  map<int, bool> state, exist;
  for (int i = 0; i < n; i++) cin >> c[i] >> id[i];
  for (int i = 0; i < n; i++) {
    if (c[i] == '+')
      exist[id[i]] = true;
    else {
      if (exist[id[i]])
        exist[id[i]] = false;
      else
        state[id[i]] = true;
    }
  }
  int ans = state.size();
  for (int i = 0; i < n; i++) {
    if (c[i] == '+')
      state[id[i]] = true;
    else {
      state.erase(id[i]);
    }
    ans = max(ans, int(state.size()));
  }
  cout << ans;
  return 0;
}
