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