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