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