K - Say "Hello"

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

Input

Output

Sample test(s)

Input
4 2 5 0 0 0 10 5 5 5 6 5 0 10 5 14 7 10 5
Output
2

Hints