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