program pedagio; var L: longint; D: longint; K: longint; P: longint; ans: longint; begin readln(L, D); readln(K, P); ans := L * K + P * (L div D); writeln(ans) end.