Recently the fruit market started testing a new price policy. After buying an apple from a merchant, the price for that merchant’s next apples is increased by 1.
Today Vasya and Petya are the only merchants selling apples, they are selling their first apple for prices a and b rubles respectively. Due to the constant supply, the amount of apples for sale is virtually unlimited.
After finding out about the new price policy, Masha went to the market early in the morning to buy N apples. She is the first in the queue, and she is wondering what’s the minimal amount of rubles required to buy the necessary number of apples.
The first line contains one integer N (1 ≤ N ≤ 109) — the number of apples that Masha is going to buy.
The second line contains one integer a (1 ≤ a ≤ 109) — the price of Vasya’s first apple.
The third line contains one integer b (1 ≤ b ≤ 109) — the price of Petya’s first apple.
Output one integer — the minimal amount of rubles that Masha could spend on N apples.
Problem Author: Valentin Zuev, prepared by Daniil Zheludkov
Problem Source: Ural School Programming Contest 2020