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