#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, min = 1000001;
  cin >> n >> m >> a >> b;
  if (n * a < min) min = n * a;
  int x1 = n / m;
  if (n % m == 0)
    if (x1 * b < min) min = x1 * b;
  if (n % m != 0 && (x1 + 1) * b) min = (x1 + 1) * b;
  int x2 = x1 * b + (n - (x1 * m)) * a;
  if (x2 < min) min = x2;
  cout << min;
  return 0;
}
