program main
implicit none
integer :: i, j, k, n, x, y

read(*,*) n
read(*,*) k
read(*,*) x
read(*,*) y

if( n<k ) then
   i = x * n
else
   i = x*k + y*(n-k)
end if
write(*,'(i0)') i



end program main
