Problem: Polycarpus just has been out of luck lately! As soon as he found a job in the "Binary Cat" cafe, the club got burgled. All ice-cream was stolen.

On the burglary night Polycarpus kept a careful record of all club visitors. Each time a visitor entered the club, Polycarpus put down character "+" in his notes. Similarly, each time a visitor left the club, Polycarpus put character "-" in his notes. We know that all cases of going in and out happened consecutively, that is, no two events happened at the same time. Polycarpus doesn't remember whether there was somebody in the club at the moment when his shift begun and at the moment when it ended.

Right now the police wonders what minimum number of distinct people Polycarpus could have seen. Assume that he sees anybody coming in or out of the club. Each person could have come in or out an arbitrary number of times.

Input

The only line of the input contains a sequence of characters "+" and "-", the characters are written one after another without any separators. The characters are written in the order, in which the corresponding events occurred. The given sequence has length from 1 to 300 characters, inclusive.

Output

Print the sought minimum number of people

Examples

Input

+-+-+


Output

1


Input

---

Output

3

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma warning(disable : 4786)
using namespace std;
template <class T>
int cntb(T i) {
  int ret = 0;
  while (i) i = (i - 1) & i, ret++;
  return ret;
}
template <class T>
int cntlz(T i) {
  int ret = 0;
  while (!((i) & (1 << 0)) && i) i /= 2, ret++;
  return ret;
}
template <class T>
T gcd(T a, T b) {
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
void frstring(string s, T& r) {
  r = 0;
  istringstream ci(s);
  ci >> r;
}
template <class T>
string tostring(T n) {
  ostringstream co;
  co << n;
  co.flush();
  return co.str();
}
template <class T>
T bigmod(T x, T n, T m) {
  T ret = 1;
  while (n > 0) {
    if (n % 2 == 1) ret = (ret * x) % m;
    x = (x * x) % m;
    n /= 2;
  }
  return ret;
}
vector<string> parse(char* ch, char* tk) {
  vector<string> ret;
  char* pch = strtok(ch, tk);
  while (pch != NULL) {
    ret.push_back(string(pch)), pch = strtok(NULL, tk);
  }
  return ret;
}
struct point {
  double x, y;
  point(double _x, double _y) {
    x = _x;
    y = _y;
  }
};
point operator-(point a) { return point(-a.x, -a.y); }
point operator-(point a, point b) { return point(a.x - b.x, a.y - b.y); }
point operator+(point a, point b) { return point(a.x + b.x, a.y + b.y); }
point operator/(point a, double b) { return point(a.x / b, a.y / b); }
point operator*(double a, point b) { return point(a * b.x, a * b.y); }
double operator*(point a, point b) { return a.x * b.y - a.y * b.x; }
double operator^(point a, point b) { return a.x * b.x - a.y * b.y; }
double mag(point a) { return sqrt(((a.x) * (a.x)) + ((a.y) * (a.y))); }
double dist(point a, point b) {
  return sqrt(((a.x - b.x) * (a.x - b.x)) + ((a.y - b.y) * (a.y - b.y)));
}
point unit(point a) { return a / mag(a); }
double proj(point a, point b) { return a ^ unit(b); }
point projv(point a, point b) {
  point ub = unit(b);
  return (a ^ ub) * ub;
}
point rotate(point a, double ang) {
  point b = point(-a.y, a.x);
  return cos(ang) * a + sin(ang) * b;
}
int main() {
  int i, j, k;
  int a, b, c;
  int mx = 0, pc = 0, nc = 0;
  string s;
  cin >> s;
  for (i = (0); i < (s.size()); i++) {
    if (s[i] == '+') {
      if (nc > 0)
        nc--, pc++;
      else
        mx++, pc++;
    }
    if (s[i] == '-') {
      if (pc > 0)
        pc--, nc++;
      else
        mx++, nc++;
    }
  }
  cout << mx << endl;
  return 0;
}