#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, i;
  string s;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    k = max(k, 0);
    if (s[i] == '+')
      k++;
    else
      k--;
  }
  if (k < 0)
    cout << 0 << endl;
  else
    cout << k << endl;
  return 0;
}
