#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
bool judge[N];
int main() {
  char ch;
  int number;
  int n;
  while (cin >> n) {
    memset(judge, 0, sizeof(judge));
    int num = 0, ans = 0;
    while (n--) {
      cin >> ch;
      cin >> number;
      if (ch == '-') {
        if (judge[number] == 1) {
          judge[number] = 0;
          num--;
        } else
          ans++;
      } else {
        if (num == ans) {
          ans++;
        }
        if (judge[number] == 0) num++;
        judge[number] = 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
