#include <bits/stdc++.h>
using namespace std;
int vis[1000006];
int n, x[1000006];
char c[1000006];
int main() {
  cin >> n;
  int ans = 0, MAX = 0;
  for (int i = 0; i < n; i++) cin >> c[i] >> x[i];
  for (int i = 0; i < n; i++) {
    if (c[i] == '+') {
      vis[x[i]] = 1;
    } else {
      if (!vis[x[i]]) {
        ans++;
        vis[x[i]] = 1;
      } else
        vis[x[i]] = 0;
    }
  }
  MAX = max(MAX, ans);
  for (int i = 0; i < n; i++) {
    if (c[i] == '+')
      ans++;
    else
      ans--;
    MAX = max(MAX, ans);
  }
  cout << MAX << endl;
  return 0;
}
