#include <bits/stdc++.h>
using namespace std;
int n, v[100];
bool pres[1000001], ent[1000001], act[100];
int cnt, ans;
int main(void) {
  char s;
  int t;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s >> t;
    act[i] = ent[t] = (s == '+');
    v[i] = t;
    if (ent[t]) pres[t] = 1;
    if (!ent[t] && !pres[t]) pres[t] = 1, cnt++;
  }
  ans = cnt;
  for (int i = 0; i < n; i++) {
    cnt += (act[i]) ? 1 : -1;
    if (ans < cnt) ans = cnt;
  }
  cout << ans;
  return 0;
}
