#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int cnt = 0, ans = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '+') cnt++;
    if (s[i] == '-') cnt--;
    if (cnt == -1) cnt = 0;
    ans = max(ans, cnt);
  }
  cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '-') cnt++;
    if (s[i] == '+') cnt--;
    if (cnt == -1) cnt = 0;
    ans = max(ans, cnt);
  }
  cout << ans << endl;
  return 0;
}
