#include <bits/stdc++.h>
using namespace std;
int cnt[1000001];
int main() {
  int n, y, t = 0, mx = 0;
  char x;
  memset(cnt, 0, sizeof(cnt));
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (x == '+') {
      cnt[y] = 1;
      t++;
      mx = max(t, mx);
    }
    if (x == '-') {
      if (cnt[y] == 1)
        t--;
      else
        mx++;
      cnt[y] = 0;
    }
  }
  cout << mx << endl;
  return 0;
}
