#include <iostream> using namespace std; #define maxSize 60 int main() { int score[maxSize]; int n, k, res; cin>>n>>k; res=0; for(int i=0; i<n; ++i) cin>>score[i]; for(int i=0; i<n; ++i) if((score[i]>=score[k-1]) && (score[i]>0)) ++res; cout<<res<<endl; return 0; }