#include <bits/stdc++.h>

int main()
{
	int n, k, x, y, fee;
	scanf("%d %d %d %d", &n, &k, &x, &y);
	if(n<=k)
		fee = n*x;
	else{
		fee = k*x;
		fee+=((n-k)*y);
	}

	printf("%d\n", fee);
	
	return 0;	
}