#include <bits/stdc++.h>
using namespace std;
const int maxn = 10e5 + 5;
long long a, b, c, d, e, f, g, n, m, i, j, sdg[maxn], lili, t;
long long x[2001][2001], z[maxn], v[200001], h[100001];
string p, s;
queue<int> q;
bool mark[maxn];
vector<long long> o[maxn], sgd;
map<long long, long long> mp;
char l, y;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  a = 0;
  b = 0;
  c = 0;
  d = 0;
  e = 0;
  f = 0;
  cin >> p;
  for (i = 0; i < p.size(); i++) {
    if (p[i] == '+') {
      a++;
    } else if (p[i] == '-') {
      a--;
    }
    if (a > b) {
      c++;
      b = c;
    } else if (a < d) {
      e++;
      d = a;
    }
  }
  f = e + c;
  cout << f;
  return 0;
}
