#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(0);
  string s;
  cin >> s;
  int pos = 0, neg = 0, re = 0;
  for (int i = 0; i < (((int)(s).size())); i++) {
    if (s[i] == '-') {
      neg++;
      if (pos) pos--;
    } else if (s[i] == '+') {
      pos++;
      if (neg) neg--;
    }
    re = max(re, max(pos, neg));
  }
  cout << re << endl;
  return 0;
}
