program ccc
implicit none

integer :: l, i, res1, res2
character(10**5+1) :: s, s1, s2

read*, s
s=trim(s)
l=len_trim(s)

res1=0
res2=0
do i=1,l,2
s1(i:i)='0'
s1(i+1:i+1)='1'
s2(i:i)='1'
s2(i+1:i+1)='0'
end do

s1=trim(s1(1:l))
s2=trim(s2(1:l))

do i=1,l
if(s(i:i)==s1(i:i)) res1=res1+1
if(s(i:i)==s2(i:i)) res2=res2+1
end do

write(*,'(i0)') min(res1,res2)

end program