#include <bits/stdc++.h>
using namespace std;
int main() {
  int lb;
  while (scanf("%d\n", &lb) == 1) {
    const int n = 12;
    unsigned A[n] = {0};
    for (int k = 0; k < n; k++) {
      scanf("%d", A + k);
    }
    int g = 0, ans = 0;
    sort(A, A + n);
    while (g < lb && ans < n) {
      ans++;
      g += A[n - ans];
    }
    if (g < lb) {
      ans = -1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
