#include <bits/stdc++.h>
using namespace std;
typedef priority_queue<pair<int, int>, vector<pair<int, int>>,
                       greater<pair<int, int>>>
    rpqpi;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int mi = 0, ma = 0, now = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == '-')
      --now;
    else
      ++now;
    mi = min(now, mi);
    ma = max(now, ma);
  }
  cout << ma - mi << '\n';
  return 0;
}
