#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, R, r1, r2, r3, r;
  cin >> n >> m >> a >> b;
  if (n % m == 0) {
    r1 = (n / m) * b;
    r2 = n * a;
    r = min(r1, r2);
  } else {
    r1 = (n / m) * b + (n % m) * a;
    r2 = n * a;
    r = min(r1, r2);
  }
  r3 = (n / m + 1) * b;
  R = min(r, r3);
  cout << R;
}
