#include <bits/stdc++.h>
using namespace std;
int n, i, cur, mi;
char c;
int main() {
  cur = mi = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf(" %c", &c);
    if (c == '-')
      cur--;
    else
      cur++;
    mi = min(mi, cur);
  }
  cout << cur - mi << endl;
  return 0;
}
