#include <bits/stdc++.h>
using namespace std;
int k;
int a[20];
void OpenFile() {
  freopen(
      "149A_BusinessTrip"
      ".inp",
      "r", stdin);
  freopen(
      "149A_BusinessTrip"
      ".out",
      "w", stdout);
}
void ReadData() {
  scanf("%d", &k);
  for (int i = 0; i < 12; i++) scanf("%d", &a[i]);
}
void SolveProblem() {
  int Res = 0;
  sort(a, a + 12);
  for (int i = 11; i >= 0; i--) {
    if (Res < k)
      Res += a[i];
    else {
      printf("%d", 12 - i - 1);
      return;
    }
  }
  if (Res >= k)
    printf("12");
  else
    printf("-1");
}
int main() {
  ReadData();
  SolveProblem();
}
