#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
char op[maxn];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf(" %c", &op[i]);
  int ans = 4 * n;
  for (int i = 0; i <= n; i++) {
    int qtd = i;
    bool ok = 1;
    for (int j = 1; j <= n; j++) {
      if (op[j] == '+')
        qtd++;
      else
        qtd--;
      if (qtd < 0) ok = 0;
    }
    if (ok) ans = min(ans, qtd);
  }
  printf("%d\n", ans);
}
