#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, ans;
  while (scanf("%d %d %d %d\n", &n, &m, &a, &b) != EOF) {
    ans = 20000000;
    for (int i = 0; i <= 1000; i++)
      for (int j = 0; j <= 1000; j++)
        if (i + m * j >= n) ans = min(ans, i * a + j * b);
    printf("%d\n", ans);
  }
  return 0;
}
