An Array and Range Additions
Given an array of integers of length .
You can modify the array using the addition operation. To apply the addition operation, you need to perform three sequential actions:
Choose any integer .
Choose any subarray of the array.
Add to each element of the chosen subarray (perform the assignment operation for ).
Find the minimum number of addition operations required to make all elements of the array pairwise distinct.
Input
The first line contains a single integer () — the length of the array.
The second line contains integers () — the elements of the array.
Output
Output a single integer — the minimum number of addition operations required to make all elements of the array pairwise distinct.
Examples
Note
In the first example, all elements of the array are pairwise distinct.
In the second example, after applying two addition operations with parameters , , and , , , the array becomes equal to .
In the third example, after applying two addition operations with parameters , , and , , , the array becomes equal to .
Scoring
( points): all elements of the array are equal to .
( points): for ; for .
( points): .
( points): .
( points): .
( points): for .
( points): no additional constraints.