#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  while (b) {
    long long x = a % b;
    a = b;
    b = x;
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long freq(string s, string s1) {
  long long count = 0;
  long long nPos = 0;
  while (nPos != -1) {
    nPos = s.find(s1, nPos + 1);
    count++;
  }
  return count;
}
long long ArSum(long long a[], long long i, long long j) {
  long long initial_sum = 0;
  return accumulate(a + i, a + j, initial_sum);
}
long long fact(long long n) {
  if (n <= 1)
    return 1;
  else {
    return n * fact(n - 1);
  }
}
int main() {
  long long n, ans = 0, x = 0;
  cin >> n;
  string s;
  cin >> s;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '-' && ans != 0)
      ans--;
    else if (s[i] == '+')
      ans++;
  }
  cout << max(x, ans);
  return 0;
}
