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