#include <bits/stdc++.h>
double const PI = 4 * atan(1.0);
using namespace std;
int k, a[22];
int main() {
  scanf("%d", &k);
  for (int i = 0; i < 12; i++) scanf("%d", &a[i]);
  sort(a, a + 12);
  int tong = 0;
  if (k <= 0) {
    printf("0");
    return 0;
  }
  for (int i = 11; i >= 0; i--) {
    tong += a[i];
    if (tong >= k) {
      printf("%d\n", 12 - i);
      return 0;
    }
  }
  printf("-1");
}
