#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
int N;
char type[MAXN];
int id[MAXN];
bool vis[1000005];
int main() {
  ios::sync_with_stdio(0);
  cin >> N;
  int cur = 0;
  for (int i = 0; i < N; i++) {
    cin >> type[i] >> id[i];
    if (type[i] == '-' && !vis[id[i]]) cur++;
    vis[id[i]] = true;
  }
  int best = cur;
  for (int i = 0; i < N; i++) {
    if (type[i] == '+')
      cur++;
    else
      cur--;
    best = max(best, cur);
  }
  cout << best << "\n";
  return 0;
}
