def abc():

    n = int(eval(input()))

    k = int(eval(input()))

    x = int(eval(input()))

    y = int(eval(input()))



    fee = 0

    if n <= k:

        fee += n * x

    else:

        fee += k * x

        fee += (n - k) * y

    print(fee)





abc()

def abc():

    n = int(eval(input()))

    k = int(eval(input()))

    x = int(eval(input()))

    y = int(eval(input()))

    if n <= k:

        print((n * x))

        return

    print((k * x + (n - k) * y))





abc()

def abc():
    n = int(eval(input()))
    k = int(eval(input()))
    x = int(eval(input()))
    y = int(eval(input()))
    fee = 0
    if n <= k:
        fee += n * x
    else:
        fee += k * x
        fee += (n - k) * y
    print(fee)


abc()

def abc():
    n = int(eval(input()))
    k = int(eval(input()))
    x = int(eval(input()))
    y = int(eval(input()))
    if n <= k:
        print((n * x))
        return
    print((k * x + (n - k) * y))


abc()

-    fee = 0 -        fee += n * x -    else: -        fee += k * x -        fee += (n - k) * y -    print(fee) +        print((n * x)) +        return +    print((k * x + (n - k) * y))