program main
   implicit none
   integer::le,cou(2)=0
   integer i
   character(100000):: s
   read(*,*)s
   le=len_trim(s)
   do i=1,le
      if(s(i:i)=="0")cou(1)=cou(1)+1
      if(s(i:i)=="1")cou(2)=cou(2)+1
   enddo
   write(*,*)minval(cou)*2
end program main
