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