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