#include <bits/stdc++.h>
using namespace std;
int n;
int ab(int x) { return x < 0 ? -x : x; }
string a;
int main() {
  cin >> a;
  int rst = 0;
  int cnt = 0;
  int in = 0;
  int out = 0;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == '+') {
      if (out)
        in++, out--;
      else
        in++;
    } else {
      if (in)
        in--, out++;
      else
        out++;
    }
  }
  cout << in + out;
}
