#include <bits/stdc++.h>
int pluss[1000009], minuss[1000009];
using namespace std;
int main() {
  int n, x;
  char e;
  cin >> n;
  int ans = 0, preans = 0;
  for (int i = 0; i < n; i++) {
    cin >> e >> x;
    if (e == '+')
      pluss[x] = 1, preans++;
    else {
      if (pluss[x] == 1)
        pluss[x] = 0, preans--;
      else
        ans += 1;
    }
    ans = max(ans, preans);
  }
  cout << ans << endl;
}
