#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, sum = 0, sum1 = 0;
  cin >> n >> m >> a >> b;
  sum = n / m;
  sum1 = n - (sum * m);
  if (sum * b < n * a) {
    cout << min((sum * b + sum1 * a), ((sum + 1) * b));
  }
  if (sum * b >= n * a) {
    cout << n * a;
  }
  return 0;
}
