#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  int tec = 0, in = 0, out = 0, ans = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '-') {
      tec--;
      if (in <= 0) {
        ans++;
        out++;
      } else {
        out++;
        in--;
      }
    } else {
      tec++;
      if (out <= 0) {
        ans++;
        in++;
      } else {
        in++;
        out--;
      }
    }
  }
  cout << ans;
  return 0;
}
