#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, sum = 0;
  cin >> a >> b >> c >> d;
  if (a <= b && c <= d)
    cout << min(a * c, d) << endl;
  else if (a <= b && c > d)
    cout << d << endl;
  else if (a % b == 0 && a > b) {
    for (int i = 0; i < a / b; i++) {
      sum += d;
    }
    cout << min(sum, a * c) << endl;
    sum = 0;
  } else if (a % b != 0 && a > b) {
    int m = a / b;
    for (int i = 0; i < m; i++) {
      sum += d;
    }
    cout << sum + min(a % b * c, d) << endl;
    sum = 0;
  }
  return 0;
}
