On Teacher's Day, Vasya decided to buy a bouquet of flowers. The store sells daisies for a hryvnias per piece and gladiolus for b hryvnias per piece (a<b). Vasya has c hryvnias. He wants to make a bouquet of as many flowers as possible, and at the same time spend as much money as possible. In other words, from all the bouquets with the maximum possible number of flowers, he wants to choose the most expensive one, but not more expensive than c hryvnias. Help him calculate the cost of such a bouquet.
Three integers a, b, c (1≤a<b≤100, 0≤c≤1000).
Print a single number - the cost of the most expensive bouquet with the maximum number of flowers.