#include <bits/stdc++.h>
int main() {
  char s[1000];
  int jia = 0, jian = 0, ans = 0;
  scanf("%s", s);
  for (int i = 0; s[i]; i++) {
    if (s[i] == '+') {
      if (jian > 0) {
        jian--;
        jia++;
      } else {
        jia++;
        ans++;
      }
    } else {
      if (jia > 0) {
        jian++;
        jia--;
      } else {
        jian++;
        ans++;
      }
    }
  }
  printf("%d\n", ans);
}
