#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  return b == 0 ? abs(a) : gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int prime[1000000];
void seive() {
  int n_prime = 1000000;
  fill_n(prime, n_prime, 1);
  prime[0] = 0;
  prime[1] = 0;
  for (int i = 2; i * i <= n_prime; i++) {
    if (prime[i]) {
      for (int j = i * i; j <= n_prime; j += i) {
        prime[j] = 0;
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  std::cin >> n;
  string s;
  std::cin >> s;
  if (s[0] == '+') {
    n = 0;
  } else {
    n = 1;
  }
  for (auto i : s) {
    if (i == '-') {
      if (n > 1) {
        n--;
      } else {
        n = 0;
      }
    } else {
      n++;
    }
  }
  std::cout << n << '\n';
  return 0;
}
