#include <bits/stdc++.h>
using namespace std;
int main() {
  char str[100010];
  cin >> str;
  int minus = 0;
  int plus = 0;
  int maxpeople = 0;
  int l = strlen(str);
  for (int i = 0; i < l; i++) {
    if (str[i] == '+') {
      minus--;
      plus++;
      if (minus < 0) minus = 0;
    } else {
      plus--;
      minus++;
      if (plus < 0) {
        plus = 0;
      }
    }
    maxpeople = max(max(minus, plus), maxpeople);
  }
  cout << maxpeople << endl;
  return 0;
}
