#include <bits/stdc++.h>
using namespace std;
inline void checkMAX(int& a, int b) {
  if (a < b) a = b;
}
inline void checkMIN(int& a, int b) {
  if (a > b) a = b;
}
int main() {
  char s[333] = {};
  cin >> s;
  int mn = 0, mx = 0, curr = 0;
  for (int i = 0; s[i]; i++) {
    if (s[i] == '+')
      curr++;
    else
      curr--;
    checkMIN(mn, curr);
    checkMAX(mx, curr);
  }
  cout << (mx - mn) << endl;
  return 0;
}
