#include <bits/stdc++.h>
using namespace std;
int main() {
  string inn;
  int mas[305] = {0};
  int sz = -1;
  cin >> inn;
  int res = 0;
  int a = 0;
  int b = 0;
  for (int i = 0; i < inn.size(); i++) {
    if (inn[i] == '+') {
      int ex = -1;
      for (int i = 0; i <= sz; i++) {
        if (mas[i] == -1) {
          ex = i;
          break;
        }
      }
      if (ex == -1) {
        sz++;
        mas[sz] = 1;
      } else {
        mas[ex] = 1;
      }
    } else {
      int ex = -1;
      for (int i = 0; i <= sz; i++) {
        if (mas[i] == 1) {
          ex = i;
          break;
        }
      }
      if (ex == -1) {
        sz++;
        mas[sz] = -1;
      } else {
        mas[ex] = -1;
      }
    }
  }
  cout << sz + 1 << endl;
  return 0;
}
