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