#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
const double pi = 3.14159265358979323;
const double eps = 1e-8;
string s;
int main() {
  while (cin >> s) {
    int ans = 0;
    int in = 0;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == '+') {
        if (ans - in == 0)
          ans++, in++;
        else
          in++;
      } else {
        if (in == 0)
          ans++;
        else
          in--;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
