def main():

    n = int(eval(input()))

    k = int(eval(input()))

    x = int(eval(input()))

    y = int(eval(input()))



    ans = 0

    for i in range(n):

        if i < k:

            ans += x

        else:

            ans += y

    print(ans)



if __name__ == '__main__':

    main()

from collections import defaultdict





def main():

    N, K, X, Y = int(eval(input())), int(eval(input())), int(eval(input())), int(eval(input()))

    ans = 0

    for i in range(N):

        ans += X if i < K else Y

    print(ans)



if __name__ == '__main__':

    main()

def main():
    n = int(eval(input()))
    k = int(eval(input()))
    x = int(eval(input()))
    y = int(eval(input()))
    ans = 0
    for i in range(n):
        if i < k:
            ans += x
        else:
            ans += y
    print(ans)


if __name__ == "__main__":
    main()

from collections import defaultdict


def main():
    N, K, X, Y = (
        int(eval(input())),
        int(eval(input())),
        int(eval(input())),
        int(eval(input())),
    )
    ans = 0
    for i in range(N):
        ans += X if i < K else Y
    print(ans)


if __name__ == "__main__":
    main()

+from collections import defaultdict + + -    n = int(eval(input())) -    k = int(eval(input())) -    x = int(eval(input())) -    y = int(eval(input())) +    N, K, X, Y = ( +        int(eval(input())), +        int(eval(input())), +        int(eval(input())), +        int(eval(input())), +    ) -    for i in range(n): -        if i < k: -            ans += x -        else: -            ans += y +    for i in range(N): +        ans += X if i < K else Y