#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, k;
  int Arr[12];
  cin >> k;
  for (i = 0; i < 12; i++) cin >> Arr[i];
  sort(Arr, Arr + 12);
  int sum = 0, counter = 0;
  for (i = 11; i >= 0; i--) {
    sum += Arr[i];
    counter++;
    if (sum >= k) break;
  }
  if (k == 0)
    cout << 0;
  else if (sum < k)
    cout << -1 << endl;
  else
    cout << counter << endl;
}
