Program ABC123C

integer(8) n,a(5)

read(*,*) n,a

if (mod(n,min(a(1),a(2),a(3),a(4),a(5)))==0) then
 write(*,*) n/min(a(1),a(2),a(3),a(4),a(5))-1+5
else
 write(*,*) n/min(a(1),a(2),a(3),a(4),a(5))+5
end if

stop
end