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