#include <bits/stdc++.h>
const int maxi = 2000000000;
using namespace std;
int k, n, sum, kol, a[111];
int main() {
  scanf("%d", &k);
  for (int i = 0; i < 12; i++) scanf("%d", &a[i]);
  sort(a, a + 12);
  for (int i = 11; i >= 0; i--) {
    if (sum >= k) {
      cout << kol << endl;
      return 0;
    }
    sum += a[i];
    kol++;
  }
  if (sum < k) {
    puts("-1");
    return 0;
  }
  cout << kol << endl;
  return 0;
}
