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