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