#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i, j, k, n, cnt = 0;
  cin >> n;
  map<int, int> m;
  for (i = 0; i < n; ++i) {
    char ch;
    int x;
    cin >> ch >> x;
    if (ch == '+') {
      m[x] = 1;
      int y = m.size();
      cnt = max(cnt, y);
    } else {
      if (m.find(x) != m.end()) {
        m.erase(x);
      } else {
        cnt += 1;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
