#include <bits/stdc++.h>
using namespace std;
long long mas[1000006];
int n;
int l[1000006];
char val[1000006];
int main() {
  cin >> n;
  int x;
  char q;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> val[i] >> l[i];
    if (val[i] == '-' && !mas[l[i]]) {
      count++;
    }
    mas[l[i]] = 1;
  }
  int ans = count;
  for (int i = 0; i < n; i++) {
    if (val[i] == '-')
      count--;
    else
      count++;
    ans = max(ans, count);
  }
  cout << ans;
  return 0;
}
