
object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val s = sc.next()
  var ans = s.length
  for (i <- Seq('0', '1')) {
    var cnt = 0
    for (j <- 0 until s.length) {
      if (j % 2 == 0 && s(j) == i) cnt += 1
      if (j % 2 == 1 && s(j) != i) cnt += 1
    }
    ans = ans.min(cnt)
  }
  println(ans)

}