#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  long pl = 0, mi = 0, potp = 0, potm = 0;
  char c;
  while (cin >> c) {
    if (c == '+') {
      if (mi > 0) --mi;
      ++pl;
    } else {
      if (pl > 0) --pl;
      ++mi;
    }
  }
  cout << pl + mi;
  return 0;
}
