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