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