#include <bits/stdc++.h>
using namespace std;
const int MAXN = 9999;
int main() {
  string s;
  int m, n, i, j, k;
  ios::sync_with_stdio(false);
  ;
  cin >> s;
  m = 0, n = 0;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == '+') {
      if (n > 0) n--;
      m++;
    } else {
      if (m > 0) m--;
      n++;
    }
  }
  cout << m + n << endl;
}
