#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, count = 0, ans = 0;
  char t = 'a';
  cin >> n;
  string s;
  cin >> s;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '+') {
      count++;
    }
    if (s[i] == '-') {
      count--;
    }
    ans = max(count, ans);
  }
  cout << ans;
  return 0;
}
