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