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