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