#include <bits/stdc++.h>
using namespace std;
int main() {
  int p = 0, m = 0;
  string str;
  while (cin >> str) {
    p = 0;
    m = 0;
    for (int i = 0; i < str.size(); i++) {
      if (str[i] == '+') {
        p++;
        if (m) m--;
      } else {
        m++;
        if (p) p--;
      }
    }
    cout << p + m << endl;
  }
  return 0;
}
