#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 5e18;
const double pi = acos(-1.0);
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
double rad(double x) { return x * pi / 180.0; }
bool isleft(pair<long long, long long> a, pair<long long, long long> b,
            pair<long long, long long> c) {
  long long det = (b.first - a.first) * (c.second - a.second) -
                  (c.first - a.first) * (b.second - a.second);
  if (det >= 0) return true;
  if (det < 0) return false;
  return false;
}
long long exp(long long a, long long b) {
  long long result = 1;
  while (b > 0) {
    if (b & 1) result = result * a % MOD;
    b >>= 1;
    a = a * a % MOD;
  }
  return result;
}
void solve() {
  long long k;
  cin >> k;
  vector<long long> vet(12);
  for (long long &i : vet) cin >> i;
  sort(vet.rbegin(), vet.rend());
  long long ans = 0;
  long long i = 0;
  for (; i < 12 and ans < k; i++) {
    ans += vet[i];
  }
  cout << (ans >= k ? i : -1) << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
}
