#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[110], i, j, sum = 0, p = 0, k;
  cin >> k;
  for (i = 0; i < 12; i++) cin >> a[i];
  sort(a, a + 12);
  i = 11;
  while (sum < k && i >= 0) {
    sum += a[i];
    p++;
    i--;
  }
  if (sum < k) p = -1;
  cout << p << endl;
}
