#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b;
  cin >> n >> m >> a >> b;
  if (n <= m) {
    int p = n * a;
    if (p < b)
      cout << p;
    else
      cout << b;
  } else {
    int d = n / m;
    int r = n % m;
    int s1 = n * a;
    int s2;
    if (r * a < b)
      s2 = d * b + r * a;
    else
      s2 = (d + 1) * b;
    cout << min(s1, s2);
  }
}
