#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  string s, t;
  while (cin >> a >> s) {
    c = 0;
    for (b = 0; b < a; b++) {
      if (s[b] == '-') {
        if (c >= 1) {
          c--;
        }
      } else {
        c++;
      }
    }
    cout << c << endl;
  }
  return 0;
}
