#include <bits/stdc++.h>
int main() {
  int n, m, a, b, p, q, cost;
  std::cin >> n >> m >> a >> b;
  p = n / m;
  q = n - p * m;
  if (q * a <= b)
    cost = q * a + p * b;
  else
    cost = (p + 1) * b;
  if (cost > n * a) cost = n * a;
  std::cout << cost;
  return 0;
}
