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