#include <bits/stdc++.h>
int main() {
  int n, m, a, b, i, paid = 0;
  scanf("%d%d%d%d", &n, &m, &a, &b);
  if (b / m < a && m < n) {
    for (i = 0; n > m; i++) {
      n = n - m;
      paid += b;
    }
    if (n * a < b) {
      paid += (n * a);
    } else {
      paid += b;
    }
    printf("%d", paid);
  } else {
    if (n * a < b || a == (b / m)) {
      paid += (n * a);
    } else {
      paid += b;
    }
    printf("%d", paid);
  }
}
