implicit none
character(100000) s
integer i,length,k
integer :: counts_odd=0,counts_even=0


read(5,*)s

read(s,*)i


length=len_trim(s)

do k=1,length
i=ishft(i,-1)
if((mod(k,2).eq.1 .and. iand(i,1).ne.0) .or.(mod(k,2).eq.0 .and. iand(i,1).ne.1) )then
 counts_odd=counts_odd+1
endif 
if((mod(k,2).eq.1 .and. iand(i,1).ne.1).or.(mod(k,2).eq.0 .and. iand(i,1).ne.0))then
 counts_even=counts_even+1
endif

enddo



write(6,*) min(counts_even,counts_odd)




end