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