#include <bits/stdc++.h>
int _ = (std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
         std::cout.precision(10), std::cout.setf(std::ios::fixed));
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T>
using vec = std::vector<T>;
using namespace std;
ll solve(const string &S, const regex &re, const string &fmt) {
  const string replaced = regex_replace(S, re, fmt);
  const ll removed = (S.size() - replaced.size());
  return removed == 0 ? 0 : solve(replaced, re, fmt) + removed;
}
int main() {
  string S;
  cin >> S;
  const regex re("(01|10)");
  const string fmt = "";
  cout << solve(S, re, fmt) << endl;
  return 0;
}
