#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n;
  cin >> n;
  string s;
  cin >> s;
  long long res = 0;
  int i = 0;
  while (i < n && s[i] == '-') i++;
  for (int j = (int)i; j <= (int)n - 1; j++) {
    if (s[j] == '+')
      res++;
    else {
      res--;
      if (res < 0) res = 0;
    }
  }
  cout << (res > 0 ? res : 0) << endl;
  return 0;
}
