var arr=readLine()!
var ba:[Bool] = arr.characters.map { if(String($0) == "0") { return false } else { return true }  }

var prev = ba[0]
var j: Int = 0
var c: Int = 0

for j = 1; j < ba.count; j+=1 {
  if( prev == ba[j] ) {
    ba[j] = !ba[j]
    c += 1
  }
  prev = ba[j]
}

print( c )