#include <bits/stdc++.h>
using namespace std;
int solve(int n, int m, int a, int b) {
  if (m * a <= b)
    return n * a;
  else
    return floor(n / m) * b + min((n % m) * a, b);
}
int main(void) {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int ans;
  int n, m, a, b;
  ans = 0;
  n = m = 1;
  a = b = 1;
  cin >> n >> m >> a >> b;
  ans = solve(n, m, a, b);
  cout << ans;
  return 0;
}
