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