#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, i, y, ctr = 0, sum = 0;
  vector<int> v;
  cin >> x;
  for (i = 0; i < 12; i++) {
    cin >> y;
    v.push_back(y);
  }
  sort(v.rbegin(), v.rend());
  if (x == 0)
    cout << "0\n";
  else {
    for (i = 0; i < 12; i++) {
      sum += v[i];
      if (sum >= x) {
        ctr++;
        break;
      } else {
        ctr++;
      }
    }
    if (sum >= x)
      cout << ctr << endl;
    else
      cout << "-1\n";
  }
  return 0;
}
