#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, amnt;
  cin >> n >> m >> a >> b;
  if (m * a <= b) {
    amnt = n * a;
    cout << amnt;
  } else {
    int remain = (n % m) * a;
    if (remain > b) {
      cout << (n / m) * b + b;
    } else {
      cout << (n / m) * b + remain;
    }
  }
  return 0;
}
