#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b;
  cin >> n >> m >> a >> b;
  int cnt1 = n * a, cnt2, cnt3 = 1000000000;
  if (n % m == 0) {
    cnt2 = (n / m) * b;
  } else {
    cnt2 = ((n / m) + 1) * b;
    cnt3 = (n / m) * b + (n % m) * a;
  }
  cout << min(cnt1, min(cnt2, cnt3)) << endl;
}
