#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, in = 0, out = 0, count = 0;
  char a[301];
  cin >> a;
  for (i = 0; i < strlen(a); i++) {
    if (a[i] == '+')
      count++;
    else
      count--;
    in = max(in, count);
    out = min(out, count);
  }
  cout << in - out;
  return 0;
}
