/*
Jackson Simoneau
SI@UCF 2026 - Intro to Competitive Programming
Contest 1

Solution to Making A Meowth: https://open.kattis.com/problems/makingameowth
*/

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, p, x, y;
    cin >> n >> p >> x >> y;

    //Compute the result
    //You will read p pages and Meowth will read p/(n-1) pages (every nth page)
    cout << p*x + (p/(n-1))*y << endl;
}