#include <bits/stdc++.h>
int main() {
  int i, j, k, n, m;
  char a[1009];
  scanf("%d", &n);
  scanf("%s", a + 1);
  for (i = 1; i <= n; i++) {
    if (a[i] != '-') break;
  }
  int ans = 0;
  for (; i <= n; i++) {
    if (a[i] == '+')
      ans++;
    else
      ans--;
    if (ans < 0) ans = 0;
  }
  if (ans > 0)
    printf("%d\n", ans);
  else
    printf("0\n");
}
