#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n = 0, m;
  int ans = 0, ans1 = 0;
  string s;
  cin >> s;
  for (i = 0; s[i] != '\0'; i++) {
    if (s[i] == '+') n++;
    if (s[i] == '-') n--;
    if (n > ans) ans = n;
    if (n < ans1) ans1 = n;
  }
  cout << ans - ans1;
  return 0;
}
