#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string str;
  cin >> str;
  int i;
  int c1 = 0;
  int max = 0;
  int max2 = 0;
  for (i = 0; i <= str.length(); i++) {
    if (str[i] == '+') {
      c1++;
    } else {
      c1--;
    }
    if (c1 > max) {
      max = c1;
    }
  }
  c1 = max;
  for (i = 0; i <= str.length(); i++) {
    if (str[i] == '-') {
      c1++;
    } else {
      c1--;
    }
    if (c1 > max) {
      max = c1;
    }
  }
  cout << max << endl;
  return 0;
}
