program sample
    implicit none
    character(100000)::s,t
    integer(8) :: i,j,k,m,n
    integer(8)::a,b,c,d
    integer(8),allocatable::x(:),y(:)
  
   
    read(*,*)s
    n=len_trim(s)
   
    a=0
    b=0
    do i=1,n
        if(s(i:i).eq.'0')then
            a=a+1
        else
            b=b+1
        end if
    end do
    c=min(a,b)
    write(*,*)2*c
    stop
end program sample
  

