#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double PI = 3.141592653589793238463;
const int N = 2e5 + 100;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  string s;
  cin >> s;
  int ans = 0, in = 0, ls = s.length();
  for (int i = 0; i < ls; i++) {
    if (s[i] == '+') {
      in++;
      ans = max(in, ans);
    } else {
      if (in)
        in--;
      else
        ans++;
    }
  }
  cout << ans << '\n';
  return 0;
}
