#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int val = 0;
  int l = 0;
  int r = 0;
  for (int i = 0, maxi = (int)s.size(); i < maxi; i++) {
    if (s[i] == '+')
      val++;
    else
      val--;
    if (val > r) r = val;
    if (val < l) l = val;
  }
  printf("%d\n", r - l);
  return 0;
}
