#include <bits/stdc++.h>
using namespace std;
string s;
vector<bool> v;
bool f;
int main() {
  cin >> s;
  for (size_t i = 0; i < s.length(); i++) {
    f = false;
    if (s[i] == '+') {
      for (size_t i = 0; i < v.size(); i++)
        if (v[i]) {
          f = true;
          v[i] = false;
          break;
        }
      if (!f) v.push_back(false);
    } else {
      for (size_t i = 0; i < v.size(); i++)
        if (!v[i]) {
          f = true;
          v[i] = true;
          break;
        }
      if (!f) v.push_back(true);
    }
  }
  cout << v.size();
  return 0;
}
