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