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