#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define ll long long
using namespace std;
int main()
{
	int n,k,x,y,cost;
	scanf("%d%d%d%d",&n,&k,&x,&y);
	if(n<=k)
	{
		cost=n*x;
	}
	else
	{
		cost=k*x+(n-k)*y;
	}
	printf("%d\n",cost);
	return 0;
}