#include <bits/stdc++.h>
using namespace std;
void solve(istream &in, ostream &out) {
  string str;
  in >> str;
  int lhs = 0, rhs = 0;
  for (char c : str) {
    if (c == '+') {
      ++lhs;
      if (rhs > 0) --rhs;
    } else {
      ++rhs;
      if (lhs > 0) --lhs;
    }
  }
  out << rhs + lhs;
}
int main() {
  solve(cin, cout);
  return 0;
}
