object Main extends App {
  var get = readLine
  var sum,sum2 = 0
  var white = '0'
  var black = '1'
  for(i <- 0 until get.size){
    if(white != get(i))
    	sum = sum + 1
    if(black != get(i))
    	sum2 = sum2 + 1
    if(white=='0') {
      white='1'
      black='0'
    }
    else {
      black='1'
      white='0'
    }
  }
  println(math.min(sum,sum2))
}