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