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