#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  vector<int> v;
  for (int i = 0; i < 12; i++) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  int months = 0, sum = 0;
  if (sum >= k) {
    cout << months;
    return 0;
  } else {
    for (int i = 0; i < v.size(); i++) {
      sum += v[i];
      months += 1;
      if (sum >= k) {
        cout << months << "\n";
        return 0;
      }
    }
  }
  cout << "-1";
  return 0;
}
