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