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