#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> dp(5, 0);
  long long N;
  cin >> N;
  vector<long long> person(5, 0);
  for (int i = 0; i < 5; i++) {
    cin >> person[i];
  }
  dp[0] = N / person[0];
  if (N % person[0] != 0) dp[0]++;
  for (int i = 1; i < 5; i++) {
    if (person[i] >= person[i - 1])
      dp[i] = dp[i - 1] + 1;
    else {
      dp[i] = N / person[i] + i;
      if (N % person[i] != 0) dp[i]++;
    }
  }
  cout << dp[4];
  return 0;
}
