import sys
sys.stdin = open("a.in","r")
sys.stdout = open("a.out","w")
a = int(input())
n = int(input())
b = int(input())
c = int(input())
m = c + b
if n<m:
    print((b+c)*a)
else:
    f = m - n
    print((b+c)*a+f)
sys.stdin.close()
sys.stdin.close()