program answer
  implicit none

  integer :: N, i, count, sum
  character(len=100000) :: S, p, q

  read(*,*) S

  N = len_trim(S)
  count = 0


  do i = 1, N, 2
     p(i:i) = '0'
     q(i:i) = '1'
  end do

  do i = 2, N, 2
     p(i:i) = '1'
     q(i:i) = '0'
  end do
 do i = 1, N
     if(S(i:i)/=p(i:i)) then
        count = count + 1
     end if
  end do

  sum = 0
  do i = 1, N
     if(S(i:i)/=q(i:i)) then
        sum = sum + 1
     end if
  end do

  if(count>=sum) then
     write(*,*) sum
  else
     write(*,*) count
  end if

  stop
 end program answer
