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