object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val S = in.head.toArray
  var c0 = 0
  var c1 = 0
  var i = 0
  while(i < S.size){
    if(S(i)-'0' == (i%2) ) c0 += 1 else c1+= 1
    i += 1
  }
  val ret = Math.min(c0, c1)
  println(ret)
}
