#include <bits/stdc++.h>
using namespace std;
int main() {
  char c;
  int cur = 0, max = 0, min = 0;
  while (cin >> c) {
    if (c == '+')
      cur++;
    else
      cur--;
    if (cur > max) max = cur;
    if (cur < min) min = cur;
  }
  cout << abs(max - min);
}
