#include <bits/stdc++.h>
int main(void) {
  char str[314];
  int now = 0, in = 0, out = 0, max = 0, tmp, i, l;
  scanf("%300s", str);
  l = strlen(str);
  for (i = 0; i < l; i++) {
    if (str[i] == '+') {
      in++;
      if (out == 0)
        now++;
      else
        out--;
    } else if (str[i] == '-') {
      out++;
      if (in == 0)
        now++;
      else
        in--;
    }
  }
  printf("%d\n", now);
  return 0;
}
