#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
const int INF = int(2e9);
const long long MOD = 998244353;
long long n;
int a[N];
int calc(int l, int r) {
  int res = 0;
  for (int i = l; i <= r; i++) res ^= a[i];
  return res;
}
int main() {
  string s;
  cin >> s;
  int cnt = 0, ans = 0, mx = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '+')
      ++cnt;
    else
      --cnt;
    if (cnt < ans) ans = cnt;
    if (cnt > mx) mx = cnt;
  }
  cout << mx - ans;
  return 0;
}
