#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int in = 0, out = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == '+') {
      if (out > 0) out--;
      in++;
    } else {
      if (in > 0) in--;
      out++;
    }
  }
  cout << in + out << endl;
}
