#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, p, q, w, e, f, g, h;
  cin >> n >> m >> p >> q;
  int l = n * p;
  w = n / m;
  int y = w * m;
  if (n % m == 0) {
    e = w * q;
  } else
    e = (w + 1) * q;
  f = w * q;
  g = n - y;
  h = f + (g * p);
  int min = l;
  if (e < min) min = e;
  if (h < min) min = h;
  cout << min;
  return 0;
}
