#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  int c = 0, plus = 0, minus = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '+') {
      plus++;
      minus--;
    } else {
      minus++;
      plus--;
    }
    if (plus < 0) plus = 0;
    if (minus < 0) minus = 0;
  }
  cout << plus + minus;
  return 0;
}
