#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000001;
const long double pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const long long MOD = 1e18 + 9;
const long long INF = 1e18 + 123;
const int nn = 1e6 + 9;
const int N = 1e7 + 123;
const int NN = 5e5 + 123;
const int PRI = 555557;
const int pri = 997;
int d[NN], u[NN], a[NN], mx, cnt;
set<int> s;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    char type;
    int b;
    cin >> type >> b;
    if (type == '+') {
      cnt++;
      mx = max(mx, cnt);
      u[b] = 1;
    } else {
      if (!u[b]) {
        mx++;
      } else {
        u[b] = 0;
        cnt--;
      }
    }
  }
  cout << mx;
}
