#include <bits/stdc++.h>
using namespace std;
const long long MXN = 1e6 + 7;
const long long INF = 1e18 + 7;
int main() {
  long long n;
  bool used[MXN] = {false};
  long long ans = 0, cnt = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    char ch;
    long long x;
    cin >> ch;
    if (ch == '+') {
      cin >> x;
      used[x] = true;
      cnt++;
      ans = max(ans, cnt);
    } else {
      cin >> x;
      if (used[x] != 1) {
        ans++;
      }
      if (used[x] == 1) {
        cnt--;
        used[x] = 0;
      }
    }
  }
  cout << ans;
  return 0;
}
