#include <bits/stdc++.h>
using namespace std;
int n, u, cur = 0, lim = 0;
bool d[1000010];
char c;
int main() {
  cin >> n;
  memset(d, 0, sizeof(d));
  for (int i = 1; i <= n; ++i) {
    cin >> c >> u;
    if (c == '+')
      d[u] = 1, ++cur;
    else if (d[u])
      d[u] = 0, --cur;
    else
      ++lim;
    lim = max(cur, lim);
  }
  cout << lim;
}
