#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string steps;
  cin >> n >> steps;
  int minus = count(steps.begin(), steps.end(), '-');
  int plus = count(steps.begin(), steps.end(), '+');
  int sum = 0;
  for (int i = 0; i < steps.length(); i++) {
    if (steps[i] == '-' && sum != 0) {
      sum--;
    } else if (steps[i] == '+') {
      sum++;
    }
  }
  cout << sum;
  return 0;
}
