#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, a, b;
  cin >> n >> m >> a >> b;
  int ans = 0;
  int i = 0;
  int rides = 0;
  while (rides < n) {
    if (rides + m <= n) {
      ans += min(b, m * a);
    } else {
      ans += min(b, (n - rides) * a);
    }
    rides += m;
  }
  cout << ans << endl;
  return 0;
}
