PROGRAM ATCODER

implicit none
integer(16) :: n,t(1:5),ans=5

read*, n,t(1:5)

ans = ans + n/minval(t)

if ( mod(n,minval(t)) == 0 ) then
  ans = ans - 1
end if

print'(i0)', ans

contains

END PROGRAM ATCODER