#include <bits/stdc++.h>
using namespace std;
const int oo = 1 << 28;
int n, u, sol, r, c, dp[105];
char a[2];
bool mar[1000005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> u;
    if (a[0] == '-' && !mar[u]) {
      for (int j = i; j >= 0; j--) {
        dp[j]++;
        sol = max(sol, dp[j]);
      }
    } else if (a[0] == '-') {
      mar[u] = 0;
      c--;
      dp[i] = c;
    } else {
      mar[u] = 1;
      c++;
      dp[i] = c;
    }
    sol = max(sol, dp[i]);
  }
  cout << sol << '\n';
  return 0;
}
