#include <bits/stdc++.h>
const int maxn = 100 + 10;
int main() {
  int n;
  scanf("%d", &n);
  char op[maxn];
  scanf("%s", op);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (op[i] == '-')
      cnt == 0 ? cnt = 0 : cnt--;
    else
      cnt++;
  }
  printf("%d\n", cnt);
}
