import scala.io.StdIn


object Main extends App {

  val S  = StdIn.readLine()

  def solve(S: String): Int = {
    val l = S.length() - 1
    var cnta = 0

    (0 to l).foreach {
      case n if n % 2 == 0 => if (S(n) == '1') cnta = cnta + 1
      case n => if (S(n) == '0') cnta = cnta + 1        
    }

    var cntb = 0
    (0 to l).foreach {
      case n if n % 2 == 0 => if (S(n) == '0') cntb = cntb + 1
      case n => if (S(n) == '1') cntb = cntb + 1        
    }

    List(cnta, cntb).min
  }

  println(solve(S))
}
  

