#include <bits/stdc++.h>
int main() {
  int i, n, m = 0;
  scanf("%d", &n);
  char op[n];
  getchar();
  gets(op);
  for (i = 0; i < n; i++) {
    if (op[i] == '-') {
      m = m - 1;
      if (m <= 0) m = 0;
    } else if (op[i] == '+') {
      m = m + 1;
    }
  }
  printf("%d\n", m);
  return 0;
}
