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