#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, mride_times, rem_sride, mride_ttl = 0, sride_ttl;
  cin >> n >> m >> a >> b;
  if (n <= m) {
    mride_times = 1;
    rem_sride = 0;
  } else {
    mride_times = n / m;
    rem_sride = n % m;
  }
  mride_ttl += mride_times * b;
  if (rem_sride) {
    if (a < b)
      mride_ttl += rem_sride * a;
    else
      mride_ttl += b;
  }
  sride_ttl = n * a;
  if (mride_ttl <= sride_ttl)
    cout << mride_ttl;
  else
    cout << sride_ttl;
  return 0;
}
