#include <bits/stdc++.h>
using namespace std;
char a[350];
int main() {
  int i, j, k, sum1, sum2, s, e;
  while (~scanf("%s", a)) {
    int t = strlen(a);
    s = 0;
    e = 0;
    int ss = 0;
    sum1 = sum2 = 0;
    for (i = 0; i < t; i++) {
      if (a[i] == '+')
        ss++;
      else
        ss--;
      s = min(s, ss);
      e = max(e, ss);
    }
    printf("%d\n", max(1, e - s));
  }
  return 0;
}
