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