#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x = 0, mn = 0, mx = 0;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '+')
      x++;
    else
      x--;
    mn = min(mn, x);
    mx = max(mx, x);
  }
  cout << mx - mn;
}
