#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1027, N = 5e4 + 7, MOD = 1e9 + 7, Mod = 1e9 + 6;
int in, out, ans;
string str;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  cin >> str;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == '+') {
      in++;
      if (out)
        out--;
      else
        ans++;
    } else {
      out++;
      if (in)
        in--;
      else
        ans++;
    }
  }
  return cout << ans << "\n", 0;
}
