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