#include <bits/stdc++.h>
using namespace std;
const long long MAX = 10007;
vector<long long>;
void abdo() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
vector<long long> vec;
long long pos;
vector<pair<int, int> > v;
char arr[100][100];
map<long long, long long> mp;
int main() {
  abdo();
  long long mx = 0, mn = 0, res = 0;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '+')
      res--;
    else
      res++;
    mx = max(mx, res);
    mn = min(mn, res);
  }
  cout << mx - mn << endl;
  return 0;
}
