#include <bits/stdc++.h>
using namespace std;
void yala_bena() {
  cin.tie(0);
  std::ios::sync_with_stdio(0);
}
void open() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
const int m_r = 5000002;
double pii = 3.1415926536;
bool in[m_r];
int main() {
  int ans = 0, sum = 0, n, a;
  char ch;
  cin >> n;
  while (n--) {
    cin >> ch >> a;
    if (ch == '+') {
      in[a] = 1;
      sum++;
      ans = max(ans, sum);
    } else {
      if (in[a]) {
        sum--;
      } else {
        ans++;
      }
      in[a] = 0;
    }
  }
  cout << ans << endl;
}
