#include using namespace std; int main(){ int L,N,ans=0; cin >> L; cin >> N; int W[N]; for(int i=0;i> W[i]; } for(int i=0;iW[j+1]){ int temp = W[j]; W[j] = W[j+1]; W[j+1] = temp; } } } for(int i=0;i=0){ ans++; L=L-W[i]; } } cout << ans << endl; }