#include <bits/stdc++.h>
using namespace std;
int n, i, x, k = 0, maxk = 0, maxkt = 0;
char c;
set<int> a;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> c >> x;
    if (c == '+') {
      k++;
      maxkt++;
      a.insert(x);
      if (maxkt > maxk) maxk = maxkt;
    } else {
      if (a.find(x) != a.end()) {
        a.erase(x);
        maxkt--;
      } else {
        maxk++;
      }
    }
  }
  cout << maxk;
  return 0;
}
