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