#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int a = 0;
  for (int i = 0; i <= n; i++) {
    char q;
    scanf("%c", &q);
    if (q == '-' && a != 0) {
      a = a - 1;
    } else if (q == '+')
      a = a + 1;
  }
  printf("%d", a);
}
