#include #include using namespace std; int main(){ int l,n,count = 0,sum = 0; int v[10001]; cin >> l >> n; for(int i=0; i> v[i]; } sort(v,v+n); for(int i=0; i l){ count--; break; } sum +=v[i]; count++; } if(sum < l) count--; cout << count << "\n"; }