import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int L = sc.nextInt(); int bn = sc.nextInt(); int[] bw = new int[bn]; int sum=0; int answer=0; for(int i=0;i=sum+bw[i]){ sum+=bw[i]; if(i==bn-1) answer = bn; }else answer = i; } System.out.println(answer); } }