#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    ll n, a, b, c, d, e;
    cin >> n >> a >> b >> c >> d >> e;
    n--;
    cout << max({n/a, n/b, n/c, n/d, n/e}) + 5 << endl;
}