#include <bits/stdc++.h>
int main() {
  char str[302];
  int lever = 0, maxplus = 0, maxminus = 0;
  scanf("%s", str);
  for (int i = 0; i < strlen(str); i++) {
    if (str[i] == '+') {
      lever++;
      if (lever > maxplus) maxplus++;
    } else {
      lever--;
      if (lever < maxminus) maxminus--;
    }
  }
  printf("%d", maxplus - maxminus);
  return 0;
}
