#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  if (k == 0) {
    cout << "0" << endl;
    return 0;
  }
  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 i = 0;
  int total = 0;
  for (; i < 12; i++) {
    total += v[i];
    if (total >= k) break;
  }
  if (i == 12)
    cout << "-1" << endl;
  else
    cout << i + 1 << endl;
}
