#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long count = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '-') {
      count--;
      if (count < 0) {
        count = 0;
      }
    } else if (s[i] == '+') {
      count++;
    }
  }
  cout << count << "\n";
  return 0;
}
