program main
  implicit none
  integer :: A,B,C,X,Y
  integer :: out,tmp,i
  read(*,*) A,B,C,X,Y
  i = 0
  out =  max(0,X-i)*A + max(0,Y-i)*B
  do i = 1,max(X,Y) 
     tmp = i * 2*C + max(0,X-i)*A + max(0,Y-i)*B
     if (tmp < out) then
        out = tmp
     end if
  end do
  write(*,'(i0)') out
  stop
end program main
