#include <bits/stdc++.h>
using namespace std;
int f[100000];
char str[100000];
int len;
int cnt;
int ans = 0;
int a, b, c;
struct Node {
  int s, e;
} node[100000];
bool cmp(const Node &a, const Node &b) { return true; }
int max(int a, int b) { return a > b ? a : b; }
int main() {
  int n, m, i, j;
  gets(str);
  len = strlen(str);
  int minn = 0;
  int ta = 0;
  int tb = 0;
  int st = 0;
  for (i = 0; i < len; i++) {
    if (str[i] == '-') {
      tb++;
      if (ta > 0) ta--;
    } else {
      ta++;
      if (tb > 0) tb--;
    }
    minn = max(minn, ta + tb);
  }
  printf("%d\n", minn);
  return 0;
}
