#include <bits/stdc++.h>
int main() {
  int n, m, a, b;
  while (scanf("%d%d%d%d", &n, &m, &a, &b) == 4) {
    int count = a * n;
    int count3 = n / m * b;
    int count2 = n / m * b;
    if (n % m != 0) {
      count3 += n % m * a;
      count2 += b;
    }
    int min = count;
    if (min > count2) min = count2;
    if (min > count3) min = count3;
    printf("%d\n", min);
  }
  return 0;
}
