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