#include <bits/stdc++.h>
using namespace std;
const int siz = 100000 + 10;
int main() {
  int l, a[12], c, b, i, len, s, k, n, m;
  scanf("%d", &k);
  for (l = 0; l < 12; l++) scanf("%d", &a[l]);
  sort(a, a + 12);
  s = n = 0;
  for (l = 11; l > -1; l--) {
    if (s < k) {
      s += a[l];
      n++;
    }
  }
  if (s >= k)
    printf("%d", n);
  else
    printf("%d", -1);
  return 0;
}
