#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
void SieveOfEratosthenes(long long n, bool* prime) {
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++)
    if (prime[p] == true)
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long dem = 0;
  long long cnt = 0;
  for (long long i = 0; i <= n - 1; i++) {
    if (s[i] == '+')
      cnt++;
    else
      dem++;
    while (cnt < dem) cnt++;
  }
  cout << cnt - dem;
  return 0;
}
