#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int res = 10000;
  for (int i = 0; i <= 100; ++i) {
    int x = i;
    bool ok = true;
    for (auto c : s) {
      if (c == '-') {
        x--;
        if (x < 0) ok = false;
      } else {
        x++;
      }
    }
    if (ok and res > x) res = x;
  }
  cout << res << endl;
}
