arr = Array.new
N = gets.to_i
A = gets.to_i
B = gets.to_i
C = gets.to_i
D = gets.to_i
E = gets.to_i
arr[0] = N
for i in 1..5
  arr[i] = 0
end
time = 0
while arr[5] < N do
  if arr[4] > E
    arr[5] += E
    arr[4] -= E
  else
    arr[5] += arr[4]
    arr[4] = 0
  end
  if arr[3] > D
    arr[4] += D
    arr[3] -= D
  else
    arr[4] += arr[3]
    arr[3] = 0
  end
  if arr[2] > C
    arr[3] += C
    arr[2] -= C
  else
    arr[3] += arr[2]
    arr[2] = 0
  end
  if arr[1] > B
    arr[2] += B
    arr[1] -= B
  else
    arr[2] += arr[1]
    arr[1] = 0
  end
  if arr[0] > A
    arr[1] += A
    arr[0] -= A
  else
    arr[1] += arr[0]
    arr[0] = 0
  end
    time += 1
  end
puts time