#include <bits/stdc++.h>
int main() {
  int min_ = 0;
  int max_ = 0;
  int delta = 0;
  for (char sign = 0; std::cin >> sign;) {
    if (sign == '-') {
      --delta;
    } else {
      ++delta;
    }
    max_ = std::max(max_, delta);
    min_ = std::min(min_, delta);
  }
  std::cout << (max_ - min_) << std::endl;
}
