#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  x.reserve(200000);
  cin >> x;
  size_t before{0};
  for (; before != x.size();) {
    before = x.size();
    x.replace(x.begin(), x.end(), "");
  }
  cout << x.size() << endl;
}
