#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)

/*
                                                                  `
                                                          .g, `.KW;` ..`
                                                         `X24o (F(p .Bd\
                                                     ` `  ,N.?m# .hJt.H   .
                                   `  `   `        ` .JgBYYH2`_!. _!`.N.d5M'
                          `   ....JgWmHHHHmaJ...  .gB6??z?vdD .. _...._~.#! `
                        ` .(gH9TC?++?====?1+?1vTHMm+?jdB"BHM= `(&  `.. .D  `
                     ` .gHY1+=?==?=?=??====?=?=?z1zTMmJTHJ,`. _.,n .``(F  `
                 ```.+Y3+?=??=????=??=?????=???=??==1zTNJ?Hm. `` T~.. J\
     `  `  `  `  `.uB1=11====?=?=??=?=?====?==?=?=?=?=1+Tm+WN, ....` (F
    ``  ..JgWMMHHM#3+=???????===1z=?=?=zzz??=?z=?=1?=?=11?HgMN~.``.`JE
     (M9C1?=?11<d@+?==?==?????=?vue?===?1dNx11++<Ws??=???=+Wa# _`.``JP `  `
  `   7Nx?====?d@+=?=?===zux1=?=jMTNe?=1z1MMNWHW9WNe?1?=+1=+M# ....`J]
    ` .J@+?=??jM1?===??=zjMR+=?1dF` ?Ne+zY?N?Nx11+MMK11??N1zdP .`.``j%
    `.M6+z1==?d@+?=1ux11&dMN+=<d@ ..` ?Me<<dK.TNJ1JMMs11<WR>d$ .``. d[ `    `
     (T9Hm?1=jM3===zMNV91MCNv1jM`.`.`.` ?Me?N-_,WNJN/Mp11d#+M%`..`. d[`
    `  `(#1?zzM+?=vjWN+z(#`dRjd\.`.`.`...`(WM\   (TM:.WR<JNjM! ...` d\
    `   MzugXH#<=?J8jMb1M$..NdF .`.`.``.`. .gY"""YNa. .TNJMd@ ..``..H~
        "=!` J#(K?=zdDdmN_  (5  `.`.`..`.`.`.+MMMm,(Wm. ?NMM%`..`. ,@  `
             (#(N+?1dt.MN(HB"=!` ..`.`.`... d#H..MMe ?N. (~W:.``.  ($
        `  ` .M>Mz=jM}..M=.JMMHm,``.`.`.``..MHMMMNdN_ ?N  .#`. . . d}   `
              dbJb1j#~ d!.dBN,.#Ms`..`..```.?NdMMEd#~. d! j$`.`.  .K`
            ` (NjN2d#_.# .MKMMMMd#_.`.`....``(TMgM9!..`.`.M:.`.`  .@
         `     JMMNdD`.b  ?NZMMEd@ .`..```.....` `...`. .(@`..`.. d{
              ` ?W#MK  H,. ?WMMB"..`.`..`.`.`.`...`.`..M6M:.`.`. .K`
                 .N/H-`.!.`..`.`_`..```` ...JdXx`..`.`.MJN_..`.. (t`
                  (NJb   `.``.`.. (gQHYBYC<<;<<?b...` (#+db...`..M-`
                   .MNp`..`..`.`..MI<>>>>>>>>>>+Jb`..`(#zzvN,`. -#M&  `
                 `.d8+Wp ..``.`.`.H>>>>>>;>>>;>><M_`.dBIzlllTW..MmvWp` `
            ` `  .#C1=1dN,`....`.`HI>>>;>>>>>>>><d{.+NzlllllllvUUOlvM[  `  `
                .#1===?=+TmJ.`... (h<>>>>>>;>><<(NgMk=llllllllllllllvWo   `
             ` .M11zz==??1?zTHaJ...(Hg++++++jgXY"~.M9zllllllllllllllld#`
            ` ` ?77WR+=?=?z=1uM#^MMMY""""7<?~`` .W6llllllllllllllllzuW^`  `
                 ` (K+ugm1?1dMP  MIWa,`..``..(gB6zllllllll=lllllzludY```
                 `  7"!(N<u#1N:` MIlvTMHkWHH9IlllzzdMRzllll=ll=ludD`
                    `  `?B=-HM_` Mmxzzzl=lzlllll1d9^(N=llllllll=dF`
                      `   .#1W-` dr7Waxll=lzuagV"!`  dRlzlzlllld#`
                      `  .#IzM] `(p ` ?"TY""=`    ` ` ?m1llllluM!  `
                 ` ` `  .M3l=dL `,@.                   ,Nzlllzd^
                     ` (@zllvdN   M_                    .Tmxud'

*/

int N, K, X, Y;
//-----------------------------------------------------------------
int main() {
    cin >> N >> K >> X >> Y;

    int ans;
    if (N <= K) ans = N * X;
    else ans = K * X + (N - K) * Y;

    cout << ans << endl;
}

Measured memory_bytes: 256