CF355B Vasya and Public Transport

Description

Vasya often uses public transport. The transport in the city is of two types: trolleys and buses. The city has $ n $ buses and $ m $ trolleys, the buses are numbered by integers from $ 1 $ to $ n $ , the trolleys are numbered by integers from $ 1 $ to $ m $ . Public transport is not free. There are 4 types of tickets: 1. A ticket for one ride on some bus or trolley. It costs $ c_{1} $ burles; 2. A ticket for an unlimited number of rides on some bus or on some trolley. It costs $ c_{2} $ burles; 3. A ticket for an unlimited number of rides on all buses or all trolleys. It costs $ c_{3} $ burles; 4. A ticket for an unlimited number of rides on all buses and trolleys. It costs $ c_{4} $ burles. Vasya knows for sure the number of rides he is going to make and the transport he is going to use. He asked you for help to find the minimum sum of burles he will have to spend on the tickets.

Input Format

The first line contains four integers $ c_{1},c_{2},c_{3},c_{4} $ $ (1

Output Format

Print a single number — the minimum sum of burles Vasya will have to spend on the tickets.

Explanation/Hint

In the first sample the profitable strategy is to buy two tickets of the first type (for the first bus), one ticket of the second type (for the second bus) and one ticket of the third type (for all trolleys). It totals to $ (2·1)+3+7=12 $ burles. In the second sample the profitable strategy is to buy one ticket of the fourth type. In the third sample the profitable strategy is to buy two tickets of the third type: for all buses and for all trolleys.