#include <bits/stdc++.h>
using namespace std;
long long int a[1000000];
char ch;
int main() {
  long long int n, i, ans1, ans2, ans3, ans4, flag, j, temp;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> ch >> temp;
    if (ch == '-') temp = -temp;
    a[i] = temp;
  }
  ans1 = -1000000001;
  ans2 = 1000000001;
  ans3 = 0;
  ans4 = 0;
  for (i = 0; i < n; i++) {
    if (a[i] > 0) {
      ans3++;
      if (ans3 > ans1) ans1 = ans3;
    } else {
      flag = 0;
      for (j = 0; j < i; j++)
        if (a[j] == -1 * a[i]) flag = 1;
      if (flag == 1) {
        ans3--;
      } else {
        if (ans1 == -1000000001)
          ans1 = 1;
        else
          ans1++;
      }
    }
  }
  if (ans1 == -1000000001)
    cout << ans4;
  else
    cout << ans4 + ans1 << endl;
  return 0;
}
