PROGRAM ATCODER

implicit none
character(len=10**5) :: s
integer :: count1=0,count2=0,size_s,i

read*, s

size_s = len_trim(s)

! 10101010....とした場合
do i = 1, size_s, 1
  if ( mod(i,2) == 1 ) then
    if ( s(i:i) /= '1' ) then
      count1 = count1 + 1
    end if
  else
    if ( s(i:i) /= '0' ) then
      count1 = count1 + 1
    end if
  end if
end do

! 010101010....とした場合
do i = 1, size_s, 1
  if ( mod(i,2) == 1 ) then
    if ( s(i:i) /= '0' ) then
      count2 = count2 + 1
    end if
  else
    if ( s(i:i) /= '1' ) then
      count2 = count2 + 1
    end if
  end if
end do

print'(i0)', min(count1,count2)

END PROGRAM ATCODER