object Main extends App {
    var get = readLine
  var a,b = 0
  var i = 0
    while(i < get.size-1){
      if(get(0)=='0') {
        if(get(i)=='0' && get(i+1)=='1')
        a=a+1
        if(get(i+1)=='0' && get(i)=='1')
        b = b+1
      }
      if(get(0)=='1') {
        if(get(i)=='1' && get(i+1)=='0')
        a=a+1
        if(get(i+1)=='1' && get(i)=='0')
        b = b+1        
      }
      i = i + 2
    }
  if(get.size-1/2-a>get.size-1/2-b)
	println(get.size/2-a)
  else
    println(get.size/2-b)
}