program main
real*8 :: n,neck,neckpos,ans
real*8 :: a(5)
read(*,*)n
do i = 1,5
read(*,*)a(i)
end do
neck = minval(a)
ans = ceiling(n/neck,8) + 4

write(*,*) int(ans,8)
end program main
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QFEa = internal global [5 x double] undef
@_QQcl.53c4065fb626baa153b2049c0e7bef7d = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4573/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca double, align 8
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.53c4065fb626baa153b2049c0e7bef7d, i32 4)
  %4 = call i1 @_FortranAioInputReal64(ptr %3, ptr nonnull %2)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.53c4065fb626baa153b2049c0e7bef7d, i32 6)
  %7 = call i1 @_FortranAioInputReal64(ptr %6, ptr nonnull @_QFEa)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %6)
  %9 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.53c4065fb626baa153b2049c0e7bef7d, i32 6)
  %10 = call i1 @_FortranAioInputReal64(ptr %9, ptr nonnull getelementptr inbounds ([5 x double], ptr @_QFEa, i64 0, i64 1))
  %11 = call i32 @_FortranAioEndIoStatement(ptr %9)
  %12 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.53c4065fb626baa153b2049c0e7bef7d, i32 6)
  %13 = call i1 @_FortranAioInputReal64(ptr %12, ptr nonnull getelementptr inbounds ([5 x double], ptr @_QFEa, i64 0, i64 2))
  %14 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %15 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.53c4065fb626baa153b2049c0e7bef7d, i32 6)
  %16 = call i1 @_FortranAioInputReal64(ptr %15, ptr nonnull getelementptr inbounds ([5 x double], ptr @_QFEa, i64 0, i64 3))
  %17 = call i32 @_FortranAioEndIoStatement(ptr %15)
  %18 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.53c4065fb626baa153b2049c0e7bef7d, i32 6)
  %19 = call i1 @_FortranAioInputReal64(ptr %18, ptr nonnull getelementptr inbounds ([5 x double], ptr @_QFEa, i64 0, i64 4))
  %20 = call i32 @_FortranAioEndIoStatement(ptr %18)
  store ptr @_QFEa, ptr %1, align 8, !tbaa !3
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep, align 8, !tbaa !3
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !3
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 28, ptr %.fca.4.gep, align 1, !tbaa !3
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !3
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !3
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !3
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 5, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 8, ptr %.fca.7.0.2.gep, align 8, !tbaa !3
  %21 = call contract double @_FortranAMinvalReal8(ptr nonnull %1, ptr nonnull @_QQcl.53c4065fb626baa153b2049c0e7bef7d, i32 8, i32 0, ptr null)
  %22 = load double, ptr %2, align 8, !tbaa !7
  %23 = fdiv contract double %22, %21
  %24 = call contract double @llvm.ceil.f64(double %23)
  %25 = fptosi double %24 to i64
  %26 = add i64 %25, 4
  %27 = sitofp i64 %26 to double
  %28 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.53c4065fb626baa153b2049c0e7bef7d, i32 11)
  %29 = fptosi double %27 to i64
  %30 = call i1 @_FortranAioOutputInteger64(ptr %28, i64 %29)
  %31 = call i32 @_FortranAioEndIoStatement(ptr %28)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputReal64(ptr, ptr) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare double @_FortranAMinvalReal8(ptr, ptr, i32, i32, ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #0

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"descriptor member", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any data access", !5, i64 0}
