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