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