Willy Wonka owns a chocolate factory that produces a variety of sweets. Occasionally, he gives away sweets for free. When this happens, a long line of children forms outside the factory, and each child receives a treat.
One of these special occasions is approaching. This time, Willy Wonka has decided to give away candies. The factory produces different types of candies. Willy Wonka plans to give each child a set of N-1 different candies. The challenge is that the quantities of each type of candy may vary, making it tricky to determine how many children can receive a gift under this plan in the best-case scenario. Your task is to figure this out.
The first line contains the integer (2 \leq N \leq 10000) — the number of different types of candies.
Each of the following lines contains a single integer — the quantity of candies of the -th type. The quantity of candies of any type is between and , inclusive.
Output a single integer — the maximum number of sets of N-1 candies that can be formed if the candies are distributed in the most optimal way.
Example 1