#include <bits/stdc++.h>
const int N = (int)1e6 + 123;
const long long linf = (long long)1e18 + 123;
const int inf = (int)1e9 + 123;
const double eps = 1e-6;
using namespace std;
char c[1011];
int a[1011];
int cnt;
bool u[10011];
int mx = -inf;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> c[i] >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    if (c[i] == '-') {
      for (int j = i - 1; j >= 1; j--) {
        if (c[j] == '+' && a[i] == a[j]) {
          goto w;
        }
      }
      cnt++;
    }
  w:;
  }
  mx = max(mx, cnt);
  for (int i = 1; i <= n; i++) {
    if (c[i] == '+') {
      cnt++;
      mx = max(mx, cnt);
    } else {
      cnt--;
      mx = max(mx, cnt);
    }
  }
  cout << mx;
  return 0;
}
