#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, k, l;
string ss;
int main() {
  cin >> ss;
  l = ss.size();
  for (int i = 0; i < l; i++) {
    if (ss[i] == '+')
      a++;
    else
      b++;
    c = a - b;
    d = max(d, c);
    k = min(k, c);
  }
  cout << d - k;
}
