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