#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T abs(T a) {
  return a < 0 ? (-a) : a;
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
int main() {
  const int MAXN = 305;
  string s;
  cin >> s;
  vector<int> vin;
  vector<int> vout;
  for (int(i) = 0; (i) < (MAXN); (i)++) {
    vin.push_back(i);
  }
  for (int(i) = 0; (i) < (MAXN); (i)++) {
    vout.push_back(i + MAXN);
  }
  set<int> res;
  for (int(i) = 0; (i) < (s.size()); (i)++) {
    if (s[i] == '+') {
      res.insert(vout.back());
      vin.push_back(vout.back());
      vout.pop_back();
    } else {
      res.insert(vin.back());
      vout.push_back(vin.back());
      vin.pop_back();
    }
  }
  cout << res.size() << endl;
  return 0;
}
