#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, a, b;
  cin >> n >> m >> a >> b;
  int brute = n * a;
  int s1 = (n / m) * b + (n % m) * a;
  int s2 = (n / m) * b + b;
  int ans = min(min(brute, s1), s2);
  cout << ans;
}
