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