program tiles
	implicit none
	character(len=10**5) :: s, p, q
	integer :: x, i, c1, c2
    
	c1 = 0
    c2 = 0
    
	read(*,*) s    
	x = len_trim(s)
    
    i = 1
	do i = 1, x, 2
		p(i:i) = '0'
        q(i:i) = '1'
    end do
    i = 1
    do i = 2, x, 2
    	p(i:i) = '1'
        q(i:i) = '0'
    end do 
	i = 1    
    do i = 1, x
    	if (p(i:i) /= s(i:i)) then
        	c1 = c1 + 1
        end if
        if (q(i:i) /= s(i:i)) then
        	c2 = c2 + 1
        end if
    end do
    write(*,*) min(c1,c2)
    stop
end program tiles