program prob3
    implicit none
    integer :: a(5), ans, i, mi
    read(*,*) a
    ans = 0
    do i = 1, 5
        ans = ans + a(i)
        ans = ((ans - 1) / 10 + 1) * 10
    end do
    mi = 10
    do i = 1, 5
        if(mod(a(i), 10) == 0) then
            cycle
        end if
        mi = min(mod(a(i), 10), mi)
    end do
    ans = ans - (10 - mi)
    write(*,*) ans

    stop
contains
end program prob3
; 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"

@_QQcl.d5bad577f754121350c47078f8cd6a4e = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4555/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
.preheader:
  %0 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %1 = alloca [5 x i32], align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d5bad577f754121350c47078f8cd6a4e, i32 4)
  store ptr %1, ptr %0, align 8, !tbaa !3
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 1
  store i64 4, 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 %0, 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 %0, 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 %0, i64 0, i32 4
  store i8 9, 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 %0, 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 %0, 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 %0, 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 %0, 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 %0, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !3
  %3 = call i1 @_FortranAioInputDescriptor(ptr %2, ptr nonnull %0)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i32, ptr %1, align 4, !tbaa !7
  %.fr = freeze i32 %5
  %6 = add i32 %.fr, -1
  %7 = srem i32 %6, 10
  %8 = add i32 %.fr, 9
  %9 = getelementptr inbounds [5 x i32], ptr %1, i64 0, i64 1
  %10 = load i32, ptr %9, align 4, !tbaa !7
  %.fr.1 = freeze i32 %10
  %11 = xor i32 %7, -1
  %12 = add i32 %8, %11
  %13 = add i32 %12, %.fr.1
  %14 = srem i32 %13, 10
  %15 = add i32 %13, 10
  %16 = getelementptr inbounds [5 x i32], ptr %1, i64 0, i64 2
  %17 = load i32, ptr %16, align 4, !tbaa !7
  %.fr.2 = freeze i32 %17
  %18 = xor i32 %14, -1
  %19 = add i32 %15, %18
  %20 = add i32 %19, %.fr.2
  %21 = srem i32 %20, 10
  %22 = add i32 %20, 10
  %23 = getelementptr inbounds [5 x i32], ptr %1, i64 0, i64 3
  %24 = load i32, ptr %23, align 4, !tbaa !7
  %.fr.3 = freeze i32 %24
  %25 = xor i32 %21, -1
  %26 = add i32 %22, %25
  %27 = add i32 %26, %.fr.3
  %28 = srem i32 %27, 10
  %29 = add i32 %27, 10
  %30 = getelementptr inbounds [5 x i32], ptr %1, i64 0, i64 4
  %31 = load i32, ptr %30, align 4, !tbaa !7
  %.fr.4 = freeze i32 %31
  %32 = xor i32 %28, -1
  %33 = add i32 %29, %32
  %34 = add i32 %33, %.fr.4
  %35 = add i32 %34, 10
  %36 = srem i32 %.fr, 10
  %.not = icmp eq i32 %36, 0
  %.1 = select i1 %.not, i32 10, i32 %36
  %37 = srem i32 %.fr.1, 10
  %.not.1 = icmp eq i32 %37, 0
  %38 = call i32 @llvm.smin.i32(i32 %37, i32 %.1)
  %.1.1 = select i1 %.not.1, i32 %.1, i32 %38
  %39 = srem i32 %.fr.2, 10
  %.not.2 = icmp eq i32 %39, 0
  %40 = call i32 @llvm.smin.i32(i32 %39, i32 %.1.1)
  %.1.2 = select i1 %.not.2, i32 %.1.1, i32 %40
  %41 = srem i32 %.fr.3, 10
  %.not.3 = icmp eq i32 %41, 0
  %42 = call i32 @llvm.smin.i32(i32 %41, i32 %.1.2)
  %.1.3 = select i1 %.not.3, i32 %.1.2, i32 %42
  %43 = srem i32 %.fr.4, 10
  %.not.4 = icmp eq i32 %43, 0
  %44 = call i32 @llvm.smin.i32(i32 %43, i32 %.1.3)
  %.1.4 = select i1 %.not.4, i32 %.1.3, i32 %44
  %45 = srem i32 %34, 10
  %46 = sub i32 %35, %45
  %.neg = add i32 %46, -10
  %47 = add i32 %.neg, %.1.4
  %48 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.d5bad577f754121350c47078f8cd6a4e, i32 18)
  %49 = call i1 @_FortranAioOutputInteger32(ptr %48, i32 %47)
  %50 = call i32 @_FortranAioEndIoStatement(ptr %48)
  %51 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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

declare i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #1

attributes #0 = { noreturn }
attributes #1 = { 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}
