#include <bits/stdc++.h>   using namespace std;   template <class T>   T abs(T a) {     return (a >= 0 ? a : -a);   }   int main() {     int k, no[12];     cin >> k;     for (int i = 0; i < 12; i++) cin >> no[i];     sort(no, no + 12);     int res = 0, i = 11;     while (k > 0 && i >= 0) {       res++;       k -= no[i];       i--;     }     if (k <= 0)       cout << res;     else       cout <<  -1 ;     return 0;   }   