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