#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cout.tie(nullptr);
  cin.tie(nullptr);
  int n;
  cin >> n;
  int pre[1000005], ans[n + 5];
  memset(pre, 0, sizeof pre);
  memset(ans, 0, sizeof ans);
  for (int i = 0; i < n; ++i) {
    char c;
    int r;
    cin >> c >> r;
    if (c == '+')
      pre[r] = 1, ans[i]++;
    else if (c == '-') {
      if (pre[r] == 1)
        pre[r] = 0, ans[i + 1]--;
      else
        ans[0]++, ans[i + 1]--;
    }
  }
  int mx = ans[0];
  for (int i = 1; i <= n; ++i) {
    ans[i] += ans[i - 1];
    mx = max(mx, ans[i]);
  }
  cout << mx << '\n';
}
