program answer
  implicit none

  integer :: N, i, count
  character(len=100000) :: S
  integer, allocatable :: b(:)

  read(*,*) S

  N = len_trim(S)
  count = 0

  allocate(b(N))
  do i = 1, N
     if(b(i)/=mod(i,2)) then
        count = count + 1
     end if
  end do

  if(count>=N/2) then
     write(*,*) N-count
  else
     write(*,*) count
  end if

  deallocate(b)
  stop
 end program answer


