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