#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  float a, b;
  cin >> n >> m >> a >> b;
  float per_cost = b / m;
  int sum = 0;
  if (per_cost < a) {
    sum += (n / m) * b;
  } else {
    sum += n * a;
  }
  sum += b > (n % m) * a ? (n % m) * a : b;
  cout << sum << endl;
  return 0;
}
