"use strict";

// read lines from stdin
let S = require("fs")
  .readFileSync("/dev/stdin", "utf8")
  .trim();

let ans = 0;

while (true) {
  let delimiter = (S[0] === "0") ? "01" : "10";

  const splitted = S.split(delimiter);

  if (splitted.length === 1) { break; }

  ans += (splitted.length - 1) * 2;
  S = splitted.join("");
}

console.log(ans);
