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