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