#include <bits/stdc++.h>
int main() {
  int c = 0, in = 0, out = 0, pos;
  char temp;
  while (1) {
    temp = getchar();
    if (temp == '\n' || temp == EOF) break;
    if (temp == '-') {
      if (in)
        in--;
      else
        c++;
      out++;
    } else {
      in++;
      if (out)
        out--;
      else
        c++;
    }
  }
  printf("%d", c);
  return 0;
}
