#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const double infd = 2e+9;
const int infi = (1 << 30) - 1;
const long long infl = (1ll << 60) - 1;
const int mod = 1e+9 + 7;
template <class T>
inline T sqr(T x) {
  return x * x;
}
const int maxN = 1e6 + 10;
bool was[maxN];
bool is[maxN];
int a[maxN];
char t[maxN];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s >> a[i];
    t[i] = s[0];
    if (t[i] == '+') {
      is[a[i]] = true;
    } else {
      if (is[a[i]] == false) {
        was[a[i]] = true;
      }
      is[a[i]] = false;
    }
  }
  int cnt = 0;
  for (int i = 0; i < maxN; i++) {
    is[i] = was[i];
    cnt += was[i];
  }
  int result = cnt;
  for (int i = 0; i < n; i++) {
    if (t[i] == '+') {
      is[a[i]] = true;
      cnt++;
      result = max(result, cnt);
    } else {
      is[a[i]] = false;
      cnt--;
    }
  }
  cout << result;
  return 0;
}
