import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int L = sc.nextInt(); int N = sc.nextInt(); int[] W = new int[N]; for(int i=0; i W[j+1]) { int temp = W[j+1]; W[j+1] = W[j]; W[j] = temp; } } } int sum = 0; int cnt = 0; for(int i=0; i L) { break; } else { sum += W[i]; cnt++; } } System.out.println(cnt); } }