#include <bits/stdc++.h>
int main() {
  int n, m, a, b;
  scanf("%d%d%d%d", &n, &m, &a, &b);
  if (a * m <= b)
    printf("%d\n", a * n);
  else {
    int left = n % m;
    int price = (n / m) * b;
    int min_price = price + left * a;
    min_price = ((min_price < price + b) ? min_price : price + b);
    printf("%d\n", min_price);
  }
  return 0;
}
