#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100000];
  string s;
  cin >> s;
  int n;
  n = int(s.length());
  int u = 301, u1 = 301;
  int max = u1;
  int min = u;
  int i = 0;
  while (i < n) {
    if (s[i] == '-') {
      ++u1;
      if (u1 > max) {
        max = u1;
      }
    } else {
      --u1;
      if (u1 < min) {
        min = u1;
      }
    }
    ++i;
  }
  cout << (max - min);
  return 0;
}
