#include <bits/stdc++.h>
using namespace std;
char a[305];
int add = 0, delet = 0;
int main() {
  scanf("%s", a);
  int maxx = 0, minn = 0, l = strlen(a);
  for (int i = 0; i < l; i++) {
    if (a[i] == '+')
      add++;
    else
      add--;
    maxx = max(add, maxx);
    minn = min(add, minn);
  }
  if (maxx == minn)
    printf("1\n");
  else
    printf("%d\n", maxx - minn);
  return 0;
}
