1. class Solution:
  2. def Next_Round(self, k, arr):

  3. kth_place = arr[k-1]
  4. count_next_round = 0

  5. for i in range(len(arr)):
  6. if arr[i] > 0:
  7. if arr[i] >= kth_place:
  8. count_next_round += 1

  9. print(count_next_round)

  10. if __name__ == '__main__':
  11. op = Solution()

  12. n_size, k = map(int, input().split())
  13. arr = list(map(int, input().split()))
  14. op.Next_Round(k, arr)