program sample
  implicit none

  integer :: a,b,c,x,y,i,aa,bb
  integer,allocatable :: sm(:)

  read(*,*) a,b,c,x,y
  allocate(sm(0:max(2*x,2*y)))

  sm=0
  do i=0,max(2*x,2*y)
     aa=int(x-i/2+0.5)
     bb=int(y-i/2+0.5)
     sm(i)=c*i+a*aa+b*bb
     if(aa<0)then
        sm(i)=sm(i)-a*aa
     endif
     if(bb<0)then
        sm(i)=sm(i)-b*bb
     endif     
  enddo

  write(*,*) minval(sm)

  stop
end program sample