import java.util.*; public class Candy{ public static void main(String[] arg){ int n,m,res = 0; Scanner sc = new Scanner(System.in); n = sc.nextInt(); m = sc.nextInt(); int[] c = new int[n]; for(int i = 0;i0){ if(c[j] > m)break; m = m - c[j]; j++; res++; } System.out.println(res); } }