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