#include <bits/stdc++.h>
int main() {
  int max, len, t1, t2, i, j;
  char str[1000];
  while (scanf("%s", str) != EOF) {
    max = 0;
    len = strlen(str);
    for (i = 0; i < len; i++) {
      t1 = 0;
      t2 = 0;
      for (j = i; j < len; j++) {
        if (str[j] == '+')
          t1++;
        else
          t2++;
        if (max < t1 - t2) max = t1 - t2;
        if (max < t2 - t1) max = t2 - t1;
      }
    }
    printf("%d\n", max);
  }
}
