#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, n1, m1;
  cin >> n >> m >> n1 >> m1;
  int t = (m1 * (n / m)) + (n1 * (n % m));
  int t1 = 0, i = 0;
  while (i < n) {
    i += m;
    t1 += m1;
  }
  int t2 = n * n1;
  int sum = min(t, min(t1, t2));
  cout << sum;
}
