Buying Flowers#891

Buying Flowers

1 second
64 megabytes
Easy

On Teacher's Day, Vasya decided to buy a bouquet of flowers. The store sells daisies for per piece and gladioluses for per piece, where a < b. Vasya has units of currency. He wants to compose a bouquet with the maximum possible number of flowers, and at the same time spend as much money as possible. In other words, among all bouquets with the largest possible number of flowers (costing no more than ), he wants to choose the most expensive one. Help him calculate the cost of such a bouquet.

Input

Three integers , , (1 \leq a < b \leq 100, 0 \leq c \leq 1000).

Output

Print a single number — the cost of the most expensive bouquet with the maximum number of flowers.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading