program prob2
    implicit none
    character(len=100005) :: S
    integer :: l, cnt, ans, i
    read(*,*) S

    l = len_trim(S)

    cnt = 0
    do i = 1, l
        if(mod(i,2) == 1) then
            if(S(i:i) == '1') then
                cnt = cnt + 1
            end if
        else
            if(S(i:i) == '0') then
                cnt = cnt + 1
            end if
        end if
    end do

    ans = cnt
    cnt = 0

    do i = 1, l
        if(mod(i,2) == 0) then
            if(S(i:i) == '1') then
                cnt = cnt + 1
            end if
        else
            if(S(i:i) == '0') then
                cnt = cnt + 1
            end if
        end if
    end do

    ans = min(ans, cnt)

    write(*,*) ans

    stop
contains
end program prob2