#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
char s[305];
int main() {
  scanf("%s", s);
  int len = strlen(s);
  int res = 0;
  int sum = 0, mini = 0, maxi = 0;
  for (int i = 0; i < len; ++i) {
    if (s[i] == '+')
      ++sum;
    else
      --sum;
    mini = min(mini, sum);
    maxi = max(maxi, sum);
  }
  cout << maxi - mini << endl;
  return 0;
}
