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