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