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