#include <bits/stdc++.h>
using namespace std;
const unsigned long long mod1 = 1000000007;
const unsigned long long mod2 = 1073676287;
const unsigned long long base1 = 1000000033;
const unsigned long long base2 = 1190494759;
vector<unsigned long long> base_pow(1000009);
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string str;
  cin >> str;
  int arr[str.size() + 1], temp = 0;
  arr[str.size()] = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == '+') {
      temp++;
    } else
      temp--;
    arr[i] = temp;
  }
  cout << *max_element(arr, arr + str.size() + 1) -
              *min_element(arr, arr + str.size() + 1);
  return 0;
}
