#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, a, b;
  cin >> n >> m >> a >> b;
  long long int price;
  price = (n / m) * b + (n % m) * a;
  long long int expected = ceil(n / double(m)) * b;
  long long int min_expected = min(price, expected);
  long long int min_actual = min(min_expected, n * a);
  cout << min_actual;
  return 0;
}
