#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(void)
{
    vector<ll> cost(5);
    ll N;
    cin >> N;
    for (int i = 0; i < 5; i++)
    {
        cin >> cost[i];
    }
    

    ll result = (ll) ceil((double) N / *min_element(cost.begin(), cost.end())) + 4;
    cout << result << endl;

    return 0;
}

#include <iostream>
#include <vector>

using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  int mod = 1000000007;
  long long sum = 0;
  for(int i = 0; i < n; i++){
    cin >> a[i];
    sum += a[i];
    sum %= mod;
  }

  long ans = 0;

  for(int j = 0; j < n; j++){
    sum -= a[j];
    if(sum < 0) sum += mod;
    ans += a[j] * sum;
    ans %= mod;
  }

  cout << ans << endl;

  return 0;
}
