#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b;
  scanf("%d %d %d %d", &n, &m, &a, &b);
  int cost = 0;
  bool flag = false;
  if ((double)b / m <= (double)a) {
    flag = true;
  }
  if (flag == false) {
    cost = a * n;
  } else {
    while (m < n) {
      cost = cost + b;
      n = n - m;
    }
    if ((n) * (a) > b) {
      cost = cost + b;
    } else {
      cost += n * a;
    }
  }
  printf("%d\n", cost);
  return 0;
}
