#include <bits/stdc++.h>
using namespace std;
int main() {
  string ss;
  cin >> ss;
  int maxx = 0, sar = 0, sek = 0, minn = 0;
  int tmpo = 0;
  int tmp;
  int arr[301];
  for (int i = 0; i < ss.size(); i++) {
    if (ss[i] == '+')
      tmpo++;
    else
      tmpo--;
    if (tmpo > maxx) maxx = tmpo;
    if (tmpo < minn) minn = tmpo;
  }
  cout << maxx - minn << endl;
}
