#include <bits/stdc++.h>
using namespace std;
int cnt[105];
int used[1000005];
struct node {
  char c;
  int x;
} a[105];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    cin >> a[i].c >> a[i].x;
  }
  memset(used, 0, sizeof(used));
  memset(cnt, 0, sizeof(cnt));
  for (int i = 1; i <= n; i++) {
    if (a[i].c == '+') {
      cnt[i]++;
      used[a[i].x] = 1;
      for (int j = i + 1; j <= n; j++) {
        if (a[j].x != a[i].x)
          cnt[j]++;
        else
          break;
      }
    } else {
      for (int j = i - 1; j >= 0; j--) {
        if (!used[a[i].x]) {
          if (a[j].x != a[i].x)
            cnt[j]++;
          else
            break;
        } else {
          used[a[i].x] = 0;
          break;
        }
      }
    }
  }
  int ans = -1;
  for (int i = 0; i <= n; i++) ans = max(ans, cnt[i]);
  printf("%d\n", ans);
  return 0;
}
