import std.stdio, std.string, std.conv, std.array, std.range, std.algorithm;

void main() {
  long n;
  long[] xs = new long[](5);
  readf("%d\n", &n);

  foreach (i; 0..5) {
    readf("%d\n", &xs[i]);
  }


  long m = cast(long)(1e16);
  long mi = -1;
  foreach (i, x; xs) {
    if (x <= m) {
      m = x;
      mi = i;
    }
  }

  long ans = (mi + 1) + (n - m + 1) / m;
  ans += 5 - (mi + 1);
  writeln(ans);
}
