#include<iostream>
#include<cstdio>
#include<string.h>
using namespace std;
int main()
{
	int n,k,a,b,money;
	cin>>n>>k>>a>>b;
	if(n>k)
	{
		money=k*a+(n-k)*b;
	}
	else
		money=n*a;
	cout<<money<<endl;
	return 0;
}