#include <bits/stdc++.h>
inline int min(int a, int b) { return a < b ? a : b; }
int main() {
  int n, c = 0;
  scanf("%d", &n);
  char s[n + 2];
  scanf("%s", s);
  for (int i = 0; i < n; ++i) {
    char x = s[i];
    if (x == '-') {
      if (c == 0) ++c;
      --c;
    } else {
      ++c;
    }
  }
  printf("%d", c);
}
