#include <bits/stdc++.h>
using namespace std;
template <class _T>
inline _T sqr(const _T& x) {
  return x * x;
}
template <class _T>
inline string tostr(const _T& a) {
  ostringstream os("");
  os << a;
  return os.str();
}
template <class _T>
inline istream& operator<<(istream& is, const _T& a) {
  is.putback(a);
  return is;
}
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-11;
int main() {
  cout << setiosflags(ios::fixed) << setprecision(10);
  char c;
  int meetin = 0;
  int meetout = 0;
  int ans = 0;
  while (cin >> c) {
    if (c == '+') {
      if (meetout > 0) {
        meetout--;
        meetin++;
      } else {
        meetin++;
        ans++;
      }
    } else {
      if (meetin > 0) {
        meetout++;
        meetin--;
      } else {
        meetout++;
        ans++;
      }
    }
  }
  printf("%d", ans);
  return 0;
}
