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