#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  long k1 = 0, k0 = 0, i, j, s = 0;
  vector<pair<long, long> > vp;
  pair<long, long> p;
  p.first = 0;
  p.second = 0;
  vp.push_back(p);
  cin >> str;
  for (i = 0; i < str.size(); i++) {
    p = vp[i];
    k1 = p.first;
    k0 = p.second;
    if (str[i] == '-') {
      k0++;
      if (k1 <= 0) {
        s++;
      } else {
        k1--;
      }
    } else {
      k1++;
      if (k0 <= 0) {
        s++;
      } else {
        k0--;
      }
    }
    p.first = k1;
    p.second = k0;
    vp.push_back(p);
  }
  cout << s;
}
