#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, one, i, j, case1, case2, case3;
  cin >> n >> m >> a >> b;
  case1 = n * a;
  case2 = (n / m + 1) * b;
  case3 = (n / m) * b + (n - (n / m) * m) * a;
  int small;
  if (case1 <= case2) {
    small = case1;
  } else {
    small = case2;
  }
  if (small >= case3) {
    small = case3;
  }
  cout << small << endl;
}
