#include <bits/stdc++.h>
using namespace std;
int main() {
  int check[500];
  int cnt = 0;
  int room = 0;
  char pm;
  int n;
  cin >> n;
  int x;
  int check_room = 0;
  while (n--) {
    cin >> pm >> x;
    if (pm == '+') {
      bool cc = false;
      for (int i = 0; i < cnt; i++) {
        if (check[i] == x) cc = true;
      }
      if (cc == false && check_room == room) {
        room++;
        check_room++;
        check[cnt++] = x;
      }
      if (check_room < room) {
        check_room++;
        check[cnt++] = x;
      }
    } else if (pm == '-') {
      bool cc = false;
      int save = 0;
      for (int i = 0; i < cnt; i++) {
        if (save == 1) {
          check[i - 1] = check[i];
        }
        if (check[i] == x) {
          cc = true;
          check_room--;
          save = 1;
        }
        if (save == 1 && i == cnt - 1) cnt--;
      }
      if (cc == false) {
        room++;
      }
    }
  }
  cout << room << endl;
  return 0;
}
