#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int main() {
  int n = 0, ans = 1, i, j, l, m = 1000000000, c;
  string s;
  cin >> s;
  c = 0;
  for (int(i) = 0; (i) < (int((s).size())); ++(i)) {
    if (s[i] == '+')
      c++;
    else
      c--;
    m = min(c, m);
  }
  for (int(i) = (1); (i) <= (-m); ++(i)) s = "+" + s;
  m = 0;
  for (i = 0; i < int((s).size()); i++) {
    if (s[i] == '+')
      m++;
    else
      m--;
    ans = max(ans, m);
  }
  printf("%d\n", ans);
  return 0;
}
