#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  vector<int> vec;
  for (int i = 0; i < 12; i++) {
    int x;
    cin >> x;
    vec.push_back(x);
  }
  sort(vec.begin(), vec.end(), greater<int>());
  int sum = 0;
  int cnt = 0;
  if (k == 0) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 0; i < 12; i++) {
    sum += vec[i];
    cnt++;
    if (sum >= k) {
      cout << cnt << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}
