#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 9;
void test_case(int tc) {
  int k;
  cin >> k;
  int n = 12;
  int arr[12];
  for (int i = 0; i <= 11; ++i) cin >> arr[i];
  sort(arr, arr + 12, greater<int>());
  int ans = 0;
  int temp = 0;
  if (k == 0) {
    cout << k << "\n";
    return;
  }
  for (int i = 0; i <= n - 1; ++i) {
    temp += arr[i];
    ans++;
    if (temp >= k) {
      cout << ans;
      return;
    }
  }
  cout << -1;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int t = 1;
  for (int tc = 1; tc <= t; ++tc) test_case(tc);
}
