program name
    implicit none
    character(100000):: s
    integer(4):: i, rc=0
    read*, s

    do i=1,len_trim(s)
        if (s(i:i) == '0') rc=rc+1
    end do

    print*, 2*min(rc,len_trim(s)-rc)
end program name