#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
const long long mod = 1000000007;
const double pi = 3.1415926536;
int used[1000000 + 1] = {0};
int main() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  memset(used, 0, sizeof(used));
  deque<pair<char, int> > ar;
  for (int i = 0; i < n; i++) {
    char c;
    int x;
    cin >> c >> x;
    if (c == '-' && !used[x]) {
      ar.push_front(make_pair('+', x));
    }
    if (c == '+')
      used[x] = 1;
    else if (c == '-')
      used[x] = 0;
    ar.push_back(make_pair(c, x));
  }
  int ans = 0, t = 0;
  for (int i = 0; i < ar.size(); i++) {
    char c = ar[i].first;
    int x = ar[i].second;
    ans = max(ans, t);
    if (c == '+')
      t++;
    else
      t--;
    ans = max(t, ans);
  }
  cout << ans;
}
