#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 31;
const double eps = 0.00000000001;
char aaa[305];
int main() {
  scanf(" %s", aaa);
  int jia = 0, jian = 0, cur = 0, ma = 0;
  for (int i = 0; i < strlen(aaa); i++) {
    if (aaa[i] == '+') {
      jia++;
      cur++;
      ma = max(ma, cur);
    } else {
      if (jia > 0) {
        jia--;
        if (cur) cur--;
      } else {
        ma++;
      }
    }
  }
  cout << ma << endl;
  return 0;
}
