#include <bits/stdc++.h>
using namespace std;
inline void prin(int n) { printf("%d\n", n); }
pair<char, int> vis[105];
int main() {
  int n, cur = 0, mx = 0;
  map<int, int> log;
  cin >> n;
  for (int i = 0; i < (int)(n); ++i) {
    cin >> vis[i].first >> vis[i].second;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (vis[i].first == '+') {
      if (log[vis[i].second] > 0) cur--;
    } else {
      cur++;
      log[vis[i].second]++;
    }
  }
  mx = max(mx, cur);
  for (int i = 0; i < (int)(n); ++i) {
    if (vis[i].first == '+') {
      cur++;
    } else
      cur--;
    mx = max(mx, cur);
  }
  cout << mx;
}
