#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int pluss = 0;
  int minuss = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '+') {
      pluss++;
      minuss = max(minuss, pluss);
    } else if (s[i] == '-' && pluss > 0) {
      pluss--;
    } else {
      minuss++;
    }
  }
  cout << minuss << endl;
}
