#include <bits/stdc++.h>
int main() {
  char a[400];
  int i, j, length, out, in;
  while (gets(a) != NULL) {
    length = strlen(a);
    out = in = 0;
    for (i = 0; i < length; i++) {
      if (a[i] == '+') {
        in++;
        if (out != 0) out--;
      } else if (a[i] == '-') {
        out++;
        if (in != 0) in--;
      }
    }
    printf("%d\n", in + out);
  }
  return 0;
}
