#include <bits/stdc++.h>
using namespace std;
int k, a[13], ans, s, i;
int main() {
  cin >> k;
  for (i = 1; i <= 12; i++) {
    cin >> a[i];
    s += a[i];
  }
  if (s < k) {
    cout << "-1" << endl;
    return 0;
  } else if (k == 0) {
    cout << "0" << endl;
    return 0;
  }
  sort(a, a + 13);
  s = 0;
  for (i = 12; i >= 1; i--) {
    s += a[i];
    ans++;
    if (s >= k) {
      cout << ans << endl;
      break;
    }
  }
  return 0;
}
