VK Cup 2012 Qualification Round 1
A
Next Round
Codeforces
800
原题
←B →
翻译中…

"Contestant who earns a score equal to or greater than the $*k*$-th place finisher's score will advance to the next round, as long as the contestant earns a positive score..." — an excerpt from contest rules.

翻译中…

A total of $*n*$ participants took part in the contest ($*n* ≥ *k*$), and you already know their scores. Calculate how many participants will advance to the next round.

翻译中…

Input

翻译中…

The first line of the input contains two integers $*n*$ and $*k*$ ($1 ≤ *k* ≤ *n* ≤ 50$) separated by a single space.

翻译中…

The second line contains $*n*$ space-separated integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ ($0 ≤ *a*_{*i*} ≤ 100$), where $*a*_{*i*}$ is the score earned by the participant who got the $*i*$-th place. The given sequence is non-increasing (that is, for all $*i*$ from $1$ to $*n* - 1$ the following condition is fulfilled: $*a*_{*i*} ≥ *a*_{*i* + 1}$).

翻译中…

Output

翻译中…

Output the number of participants who advance to the next round.

翻译中…

Note

翻译中…

In the first example the participant on the 5th place earned 7 points. As the participant on the 6th place also earned 7 points, there are 6 advancers.

翻译中…

In the second example nobody got a positive score.

翻译中…

样例

Input #1
8 5
10 9 8 7 7 7 5 5
Output #1
6
InputCopy OutputCopy
Input #2
4 2
0 0 0 0
Output #2
0
InputCopy OutputCopy
题目信息
题号
158A
时间限制
3 s
内存限制
256 MB
标签
*special
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。