C. Score Game
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 2
2 1
Output
3
Input
4 5
1 0 1 1 1
Output
1
Input
3 1
3
Output
1