#include <bits/stdc++.h>
using namespace std;
int main() {
  int tot, m_ride, one_ride_cost, m_ride_cost;
  cin >> tot >> m_ride >> one_ride_cost >> m_ride_cost;
  int cost = 0;
  while (tot) {
    if (m_ride > tot) {
      cost += min(m_ride_cost, tot * one_ride_cost);
      tot = 0;
    } else {
      int min_one = m_ride_cost;
      int min_two = m_ride * one_ride_cost;
      tot -= m_ride;
      cost += min(min_one, min_two);
    }
  }
  cout << cost;
}
