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