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