#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> arr;
  vector<int>::iterator it;
  vector<int>::reverse_iterator rit;
  int n, num;
  cin >> n;
  for (int i = 0; i < 12; i++) {
    cin >> num;
    arr.push_back(num);
  }
  sort(arr.begin(), arr.begin() + 12);
  int count = 0, sum = 0;
  for (rit = arr.rbegin(); rit < arr.rend(); rit++) {
    if (sum >= n) break;
    sum += *rit;
    count++;
  }
  if (sum >= n)
    cout << count << endl;
  else if (sum < n)
    cout << -1 << endl;
  return 0;
}
