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