#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0, i;
  char a[105];
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    if (a[i] == '-') {
      if (sum != 0) sum = sum - 1;
    } else
      sum = sum + 1;
  }
  cout << sum << endl;
  return 0;
}
