program main
	implicit none
	character(100010) :: S
	integer :: i, counter_F0, counter_E1, counter_F1, counter_E0
	read(*, *) S
	counter_F0 = 0
	counter_F1 = 0
	counter_E0 = 0
	counter_E1 = 0
	do i = 1, len_trim(S), 2
		if(S(i:i) == "1") then
			counter_F0 = counter_F0 + 1
		end if
	end do
	do i = 2, len_trim(S), 2
		if(S(i:i) == "0") then
			counter_E1 = counter_E1 + 1
		end if
	end do
	counter_F0 = counter_F0 + counter_E1
	
	do i = 1, len_trim(S), 2
		if(S(i:i) == "0") then
			counter_F1 = counter_F1 + 1
		end if
	end do
	do i = 2, len_trim(S), 2
		if(S(i:i) == "1") then
			counter_E0 = counter_E0 + 1
		end if
	end do
	counter_F1 = counter_F1 + counter_E0
	
	write(*, *) min(counter_F0, counter_F1)
end program main