#include <bits/stdc++.h>
using namespace std;
long long n, m, k, l, r, c = 0, sum = 0, a, b, x, y, z, v, s, c1, c2;
long long Ar[2000001 + 5];
vector<long long> V;
set<long long> S;
map<long long, long long> Mp;
priority_queue<long long> Pq;
char str[500];
void solve() {
  long long i = 0;
  c1 = 0;
  c2 = 0;
  while (i < n && str[i] == '-') i++;
  for (; i < n; i++) {
    if (str[i] == '+')
      c++;
    else {
      if (c) c--;
    }
  }
  printf("%I64d\n", c);
}
int main() {
  scanf("%I64d", &n);
  scanf("%s", str);
  solve();
  return 0;
}
