import scala.io.{StdIn => in}

object Main extends App {
  val s = in.readLine.toArray.map(_ - '0')

  def rec(acc:Int ,cnt:Int, init:Int):Int = {
    if(cnt == s.size) acc
    else {
      if(cnt % 2 == 0) {
        debug(cnt, s(cnt), init, s(cnt) != init)
        if(s(cnt) == init) rec(acc+1, cnt+1, init)
        else rec(acc, cnt+1, init)
      }
      else {
        debug(cnt, s(cnt), init, s(cnt) != init)
        if(s(cnt) != init) rec(acc+1, cnt+1, init)
        else rec(acc, cnt+1, init)
      }
    }
  }

  val res1 = rec(0,0,0)
  val res2 = rec(0,0,1)
  debug(res1, res2)
  val ans = if(s.size == 1) 0 else res1 min res2
  println(ans)

  def debug(any:Any*):Unit = {
    if(this.getClass.toString != "class Main$")
      println(any.mkString(" "))
  }
}