The Birthday Party

No attempts yetTime limit1sMemory limit128 MB

Problem

Little Kasia is throwing a birthday party. For the occasion she bought nn different kinds of candy; there are xkx_k candies of the kk-th kind.

Kasia hands the candy out to the guests she invites. For each kind, every guest must receive the same number of candies, and candies cannot be broken into pieces. When more than one amount per guest is possible, she always picks the largest one. For example, with 1010 candies and 44 guests she could give each person 00, 11, or 22 candies, so she gives the maximum, 22 each. Thus if there are mm guests, every guest receives xk/m\lfloor x_k / m \rfloor candies of the kk-th kind and Kasia keeps xkmodmx_k \bmod m of them.

Kasia has not tasted any of the candy yet, so she wants at least one candy of every kind to remain for herself after the sharing. In other words, for every kk the remainder of xkx_k divided by mm must be at least 11. Kasia is not very sociable, so find the smallest number of guests mm she must invite to satisfy this condition.

Input

The first line contains an integer nn, the number of candy kinds (1n1061 \le n \le 10^6).

The second line contains nn integers xkx_k, separated by spaces, where xkx_k is the number of candies of the kk-th kind (1xk1051 \le x_k \le 10^5).

Output

Print a single integer: the smallest number of guests Kasia must invite.