#include <bits/stdc++.h>
using namespace std;
bool cmp(int x, int y) { return x > y; }
int main() {
  int n;
  int m[12];
  while (cin >> n) {
    int ans = 0;
    int temp = 0;
    for (int i = 0; i < 12; i++) {
      cin >> m[i];
    }
    sort(m, m + 12, cmp);
    for (int i = 0; i < 12 && n > temp; i++) {
      temp += m[i];
      ans++;
    }
    if (n > temp) {
      cout << -1 << endl;
    } else {
      cout << ans << endl;
    }
  }
  return 0;
}
