#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, arr[12], res = 0, total = 0;
  scanf("%i", &k);
  for (int i = 0; i < 12; i++) scanf("%i", &arr[i]);
  sort(arr, arr + 12, greater<int>());
  int i = 0;
  while (total < k && i < 12) {
    total += arr[i];
    res++;
    i++;
  }
  if (total < k)
    printf("%i", -1);
  else
    printf("%i", res);
}
