import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val s = sc.next()

  val t01 = Array(s.length) { if (it % 2 == 0) {'0'} else {'1'} }
  val t10 = Array(s.length) { if (it % 2 == 0) {'1'} else {'0'} }


  var count01 = 0
  var count10 = 0
  for (i in 0 until s.length)  {
    val c = s[i]
    if (c != t01[i]) count01++
    if (c != t10[i]) count10++
  }

  val ans = Math.min(count01, count10)
  println(ans)
}
