#include <bits/stdc++.h>
using namespace std;
int *arr;
int main() {
  int n, a;
  char ch;
  string str;
  scanf("%d", &n);
  bool flag;
  bool arr4[n + 1];
  vector<int> arr2;
  arr = new int[1000001];
  for (int i = 1; i <= n; i++) {
    cin >> str;
    scanf("%d", &a);
    if (str == "+") {
      arr[a] = 1;
      arr4[i] = true;
    } else {
      arr4[i] = false;
      if (arr[a] == 1)
        arr[a] = 0;
      else
        arr2.push_back(a);
    }
  }
  int count = 0;
  int max = 0;
  while (!arr2.empty()) {
    arr2.pop_back();
    count++;
  }
  max = count;
  for (int i = 1; i <= n; i++) {
    flag = arr4[i];
    if (flag == true)
      count++;
    else
      count--;
    if (count > max) max = count;
  }
  printf("%d\n", max);
  return 0;
}
