#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, a[12], s = 0;
  cin >> k;
  for (int i = 0; i < 12; i++) {
    cin >> a[i];
    s += a[i];
  }
  if (s < k)
    cout << "-1" << endl;
  else {
    sort(a, a + 12);
    for (s = 11; k > 0; s--) k -= a[s];
    cout << 11 - s << endl;
  }
  return 0;
}
