#include <bits/stdc++.h>
using namespace std;
int cnt = 0;
vector<int> a(26);
void func(string s, int k) {
  for (int i = 0; i < s.size(); ++i) {
    a[s[i] - 'A'] += k;
  }
}
int main() {
  int k, ans = 0, cnt = 0;
  cin >> k;
  vector<int> a(12);
  for (int i = 0; i < 12; ++i) scanf("%d", &a[i]);
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  if (!k) {
    printf("0");
    return 0;
  }
  for (int i = 0; i < 12; ++i) {
    cnt += a[i];
    ++ans;
    if (cnt >= k) {
      cout << ans;
      return 0;
    }
  }
  printf("-1");
  return 0;
}
