#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const* argv[]) {
  int n;
  pair<char, int> a[105];
  int pres[105];
  cin >> n;
  memset(a, 0, sizeof a);
  memset(pres, 0, sizeof pres);
  for (int i = 0; i <= n + 1; ++i) pres[i] = 0;
  for (int i = 1; i <= n; ++i) {
    char c;
    int x;
    cin >> c >> x;
    a[i] = {c, x};
  }
  int sol = -22;
  int vis[105];
  memset(vis, 0, sizeof vis);
  for (int i = 1; i <= n; ++i) {
    if (a[i].first == '-' && !vis[i])
      for (int j = i - 1; j >= 0; --j) {
        if (j == 0)
          pres[j]++;
        else if (a[j].first == '+' && a[i].second == a[j].second)
          break;
        else
          pres[j]++;
      }
    else
      for (int j = i; j <= n + 1; ++j) {
        if (j == n + 1)
          pres[j]++;
        else if (a[j].first == '-' && a[i].second == a[j].second) {
          vis[j] = 1;
          break;
        } else
          pres[j]++;
      }
  }
  for (int i = 0; i <= n + 1; ++i) {
    sol = max(sol, pres[i]);
  }
  cout << sol << "\n";
  return 0;
}
