program main
Implicit None
	integer(8)::n,i,p1=0,p2=0
	character(len=100000)::s
	
	read*,s
	n = len_trim(s)
	
	do i =1,n
		if(mod(i,2)== 0)then
			if(s(i:i) == "0")then
				p1 = p1+1
			endif
			else
			if(s(i:i) == "1")then
				p1 = p1+1
			endif
		endif
	enddo
	
	do i =1,n
		if(mod(i,2)== 0)then
			if(s(i:i) == "1")then
				p2 = p2+1
			endif
			else
			if(s(i:i) == "0")then
				p2 = p2+1
			endif
		endif
	enddo
	
	print"(i0)",min(p1,p2)
end program main