#include <bits/stdc++.h>
int main() {
  int i, j, swap, growth = 0, k;
  int arr[15];
  scanf("%d", &k);
  for (i = 0; i < 12; ++i) scanf("%d", &arr[i]);
  for (i = 0; i < 11; ++i) {
    for (j = i + 1; j < 12; ++j) {
      if (arr[j] > arr[i]) {
        swap = arr[j];
        arr[j] = arr[i];
        arr[i] = swap;
      }
    }
  }
  for (i = 0; i < 12; ++i) {
    if (growth >= k)
      break;
    else
      growth += arr[i];
  }
  if (growth >= k)
    printf("%d\n", i);
  else
    printf("-1\n");
  return 0;
}
