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