x, y, w, s = map(int, input().split())
if s < 2 * w:
    cost = min(x, y) * s
    diff = max(x, y) - min(x, y)
    if diff * s < diff * w:
        if diff % 2 == 0:
            cost += diff * s
        else:
            cost += (diff - 1) * s
            cost += w
    else:
        cost += w * diff
else:
    cost = (x + y) * w
print(cost)

4fdddabd5c1f71c1d843595a546cd7ba6ba16a96
<mask token>

<mask token>
if s < 2 * w:
    cost = min(x, y) * s
    diff = max(x, y) - min(x, y)
    if diff * s < diff * w:
        if diff % 2 == 0:
            cost += diff * s
        else:
            cost += (diff - 1) * s
            cost += w
    else:
        cost += w * diff
else:
    cost = (x + y) * w
print(cost)

x, y, w, s = map(int, input().split())
if s < 2 * w:
    cost = min(x, y) * s
    diff = max(x, y) - min(x, y)
    if diff * s < diff * w:
        if diff % 2 == 0:
            cost += diff * s
        else:
            cost += (diff - 1) * s
            cost += w
    else:
        cost += w * diff
else:
    cost = (x + y) * w
print(cost)
