#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::ios;
using std::string;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int n = 0;
  cin >> n;
  string s = "";
  cin >> s;
  int res = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '-')
      res--;
    else
      res++;
    if (res < 0) {
      ans++;
      res++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '+')
      ans++;
    else
      ans--;
  }
  cout << ans << "\n";
  return 0;
}
