program main
implicit none
character(len=10**5) :: s
integer :: l,i,a,b,nc

read(*,*) s
l = len_trim(s)

nc = 0
read(s(1:1),*) a
do i = 2, l
   read(s(i:i),*) b
   if(a/=b) then
      nc = nc+1
   end if
end do
write(*,'(i0)') nc*2

end program main
