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>
using namespace std;
template <class T1>
void deb(T1 e) {
  cout << e << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
void BINARY(int n) {
  cout << "Mask: ";
  for (int i = 10; i >= 0; i--)
    if (n & (1 << i))
      cout << 1;
    else
      cout << 0;
  cout << endl;
}
template <class T>
inline T sqr(T n) {
  return n * n;
}
template <class T>
T Abs(T x) {
  return (x > 0) ? x : -x;
}
template <class T>
inline double LOG(T a, T b) {
  return (log(a) / log(b));
}
template <class T>
T power(T B, T P) {
  return (P == 0) ? 1 : B * (power(B, P - 1));
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
int BigMod(T B, T P, T M) {
  if (P == 0)
    return 1;
  else if (P % 2 == 0)
    return sqr(BigMod(B, P / 2, M)) % M;
  else
    return (B % M) * (BigMod(B, P - 1, M)) % M;
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / (gcd(a, b)));
}
template <class T>
inline T MOD(T a, T b) {
  return (((a % b) + b) % b);
}
int Set(int n, int p) { return n = (n | (1 << p)); }
int Clear(int n, int p) { return n = (n & ~(1 << p)); }
int Check(int n, int p) { return (n & (1 << p)); }
int Toggle(int n, int p) {
  if (Check(n, p)) return n = Clear(n, p);
  return n = Set(n, p);
}
bool isUpperCase(char c) { return c >= 'A' && c <= 'Z'; }
bool isLowerCase(char c) { return c >= 'a' && c <= 'z'; }
bool isVowel(char c) {
  c = tolower(c);
  if (c == 'a' or c == 'e' or c == 'i' or c == 'o' or c == 'u') return 1;
  return 0;
}
typedef unsigned long long ull;
int main() {
  string s;
  cin >> s;
  stack<char> S;
  int in = 0, out = 0;
  for (__typeof(0) i = (0); i < (int)s.size(); i++) {
    if (s[i] == '+') {
      if (out) out--;
      in++;
    } else {
      if (in) in--;
      out++;
    }
  }
  cout << in + out << endl;
  return 0;
}