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