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