#include <bits/stdc++.h>
using namespace std;
const long d3 = 1000;
const long d4 = 10000;
const long d5 = 100000;
const long d6 = 1000000;
const long d7 = 10000000;
const long d8 = 100000000;
const long d9 = 1000000000;
int main() {
  string s = "";
  cin >> s;
  int in = 0;
  int out = 0;
  int maxc = 0;
  for (int i = 0; i < (int)s.length(); i++) {
    if (s[i] == '+') {
      if (out == 0) {
        in++;
      } else {
        in++;
        out--;
      }
    }
    if (s[i] == '-') {
      if (in == 0) {
        out++;
        maxc++;
      } else
        in--;
    }
    if (max(in, out) > maxc) maxc = max(in, out);
  }
  cout << maxc;
  return 0;
}
