#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int MAX = 1e7 + 10;
const double pi = 3.1415926536;
void solve() {
  long long n, i;
  while (cin >> n) {
    long long a[n + 1];
    char s[n + 1];
    for (int i = 0; i < n; ++i) {
      cin >> s[i] >> a[i];
    }
    bool f[1000001];
    memset(f, 0, sizeof(f));
    long long ans = 0, state = 0;
    for (int i = 0; i < n; i += 1) {
      if (s[i] == '+') {
        f[a[i]] = 1;
        ++state;
      } else {
        if (f[a[i]] == 1) {
          state--;
          f[a[i]] = 0;
        } else {
          ++ans;
          f[a[i]] = 0;
        }
      }
      ans = max(state, ans);
    }
    cout << ans << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
