#include <bits/stdc++.h>
using namespace std;
using std::map;
const int CMAX = 100005;
const char Cfd[] = "", Cfr[] = "";
int main() {
  int n, m, a, b;
  cin >> n >> m >> a >> b;
  int res = min(n * a, (n / m) * b + (n % m) * a);
  int res2 = ((n / m) + 1) * b;
  res = min(res, res2);
  cout << res;
  return 0;
}
