#include <bits/stdc++.h>
using namespace std;
vector<int> v;
set<int> s;
map<string, int> mp;
int n, a, b, cnt, ans;
int main() {
  cin >> n;
  for (int i = 0; i < 12; i++) {
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  for (int i = v.size() - 1; i >= 0; i--) {
    if (ans >= n) {
      cout << cnt;
      return 0;
    } else {
      ans += v[i];
      cnt++;
    }
  }
  if (ans >= n) {
    cout << cnt;
  } else {
    cout << -1;
  }
}
