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