program main
   implicit none
   character(100000)c,d,e
   integer::i,le,dl=0,el=0
   read(*,*)c
   le=len_trim(c)
   do i=1,le,2
     if(c(i:i)=='0')then
        dl=dl+1
     else
        el=el+1
     endif
   enddo
   do i=2,le,2
     if(c(i:i)=='1')then
        dl=dl+1
     else
        el=el+1
     endif     
   enddo
   write(*,'(i0)')min(dl,el)
end program main
