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