When the Bride asked Hanzo, the greatest and finest katana forger the world has ever seen, to craft a new weapon, the master was hesitant, as it had been decades since his last creation and the process was rather complicated.
Nevertheless, sympathizing with the Bride's story and mission, Hanzo decided to call you — the smartest person he knows — and explain step-by-step his forging method:
More formally, let $$$a_i$$$ be the sharpness value of the $$$i$$$-th part of Hanzo's blade. The operation is defined as follows:
Hanzo stated that the sharpness of the blade is the most important part of forging a great katana. However, it is also by far the most difficult step, and he feels he's not always making the most of the blade. Therefore, help him minimize the number of distinct sharpness values by developing a program that receives the initial sharpness levels of the blade and performs Hanzo's operation any number of times.
The input consists of two lines. The first line contains a single integer $$$N$$$ $$$(1 \le N \le 2 \cdot 10^5)$$$, the number of parts into which Hanzo divided the blade. The second line contains $$$N$$$ numbers $$$(1 \le a_i \le 10^9)$$$, the sharpness values of each part of the blade.
Print a single integer, the minimum number of distinct sharpness values on the blade after applying the process described by Master Hanzo.
51 2 2 2 1
1
71 2 3 1 4 5 4
2
31 2 3
3