E - Farmer John and the Luckiest Cow

Languages: C++, Java, Python, Kotlin
Time & Memory limits: (details)

Input

Output

Sample test(s)

Input
6 3 3 4 1 5 6 2 3
Output
3
Input
6 6 10 6 5 4 3 2 1
Output
3