#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, -1, 1}, dy[] = {-1, 1, 0, 0};
const int MAX = 1e6 + 11;
int Vis[MAX];
int main() {
  int count_v = 0;
  int x;
  scanf("%d", &x);
  vector<pair<int, char>> myD(x);
  for (int i = 0; i < myD.size(); i++) {
    int nm;
    char c;
    cin >> c >> nm;
    myD[i] = make_pair(nm, c);
    if (!Vis[nm] && c == '-') count_v++;
    Vis[nm] = 1;
  }
  int ans = count_v;
  for (int i = 0; i < myD.size(); i++) {
    if (myD[i].second == '-')
      count_v--;
    else {
      count_v++;
      ans = max(count_v, ans);
    }
  }
  cout << ans;
  return 0;
}
