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