#include <bits/stdc++.h>
using namespace std;
const int M = 5;
string s;
int main() {
  cin >> s;
  int cur = 0, ansx = 0, ansn = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '+')
      cur++;
    else
      cur--;
    if (cur > ansx) ansx = cur;
    if (cur < ansn) ansn = cur;
  }
  cout << ansx - ansn;
  return 0;
}
