#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
const int INF = int(1e9);
int main() {
  string s;
  int vi = 0, bi = 0, re = 1;
  cin >> s;
  for (int i = 0; i < int(s.size()); i++) {
    if (s[i] == '+') {
      vi += 1;
      bi -= 1;
      bi = max(bi, 0);
    } else {
      bi += 1;
      vi -= 1;
      vi = max(vi, 0);
    }
    re = max(re, max(vi, bi));
  }
  cout << re << endl;
}
