#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
const int M = 21;
const int MAXK = 1e5 + 3;
const int Candy = 1e6 + 3;
const int mod = 1e9 + 7;
const long long inf = 1e18;
const double pi = 3.1415926535897932384626433;
const long double eps = 1e-12;
long long fast_pow(long long a, long long b) {
  long long res = a, ret = 1;
  while (b > 0) {
    if (b % 2) ret = (ret * res) % mod;
    res = (res * res) % mod;
    b /= 2;
  }
  return ret;
}
long long fact(long long n) {
  int first = 1;
  for (long long i = (2); i <= (n); ++i) first = first * i % mod;
  return first;
}
long long Cnk(long long n, long long r) {
  r = min(r, n - r);
  long long ans = 1;
  for (int i = (n); i >= (n - r + 1); --i) ans = (ans * i) % mod;
  for (long long i = (1); i <= (r); ++i)
    ans = (ans * fast_pow(i, mod - 2)) % mod;
  return ans;
}
int n, cnt;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s;
  for (long long i = 0; i < n; ++i) {
    if (s[i] == '+')
      cnt++;
    else if (s[i] == '-' && cnt != 0)
      cnt--;
  }
  cout << cnt;
  return (!false && !true) || ((long long)((long long)(1713 + 2377 + 1464) *
                                           (long long)(1713 + 2377 + 1464) *
                                           (long long)(1713 + 2377 + 1464)) !=
                               (long long)(171323771464));
}
