program colorful_leaderboard
  implicit none
  integer :: n, a(100), i, c(0:8), r, m
  a = 0
  c = 0
  read(*,*) n
  read(*,*) a(1:n)
  do i = 1, n
    r = a(i)/400
    if (r.gt.8) r = 8
    c(r) = c(r) + 1
  end do
  m = 0
  do i = 0, 7
    if (c(i).gt.0) m = m + 1
  end do
  if (m.eq.0) then
    write(*,'(i0,x,i0)') 1, c(8)
  else
    write(*,'(i0,x,i0)') m, m+c(8)
  end if
  stop
end program colorful_leaderboard
; 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 [100 x i32] undef
@_QFEc = internal unnamed_addr global [9 x i32] undef
@_QQcl.9698778f54bc51754a25226305821c92 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7214/source.f\00"
@_QQcl.2869302C782C693029 = linkonce constant [9 x i8] c"(i0,x,i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
.preheader14.preheader:
  %0 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %1 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) @_QFEa, i8 0, i64 400, i1 false), !tbaa !3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) @_QFEc, i8 0, i64 36, i1 false), !tbaa !3
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.9698778f54bc51754a25226305821c92, i32 6)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.9698778f54bc51754a25226305821c92, i32 7)
  %6 = load i32, ptr %1, align 4, !tbaa !3
  %7 = call i32 @llvm.smax.i32(i32 %6, i32 0)
  %8 = zext i32 %7 to i64
  store ptr @_QFEa, ptr %0, align 8, !tbaa !7
  %.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 !7
  %.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 !7
  %.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 !7
  %.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 !7
  %.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 !7
  %.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 !7
  %.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 !7
  %.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 %8, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.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 !7
  %9 = call i1 @_FortranAioInputDescriptor(ptr %5, ptr nonnull %0)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %11 = load i32, ptr %1, align 4, !tbaa !3
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph.preheader, label %.preheader

.lr.ph.preheader:                                 ; preds = %.preheader14.preheader
  %13 = zext i32 %11 to i64
  br label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %.preheader14.preheader
  %14 = load i32, ptr @_QFEc, align 16, !tbaa !3
  %15 = icmp sgt i32 %14, 0
  %16 = zext i1 %15 to i32
  %17 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @_QFEc, i64 0, i64 1), align 4, !tbaa !3
  %18 = icmp sgt i32 %17, 0
  %19 = zext i1 %18 to i32
  %spec.select.1 = add nuw nsw i32 %16, %19
  %20 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @_QFEc, i64 0, i64 2), align 8, !tbaa !3
  %21 = icmp sgt i32 %20, 0
  %22 = zext i1 %21 to i32
  %spec.select.2 = add nuw nsw i32 %spec.select.1, %22
  %23 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @_QFEc, i64 0, i64 3), align 4, !tbaa !3
  %24 = icmp sgt i32 %23, 0
  %25 = zext i1 %24 to i32
  %spec.select.3 = add nuw nsw i32 %spec.select.2, %25
  %26 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @_QFEc, i64 0, i64 4), align 16, !tbaa !3
  %27 = icmp sgt i32 %26, 0
  %28 = zext i1 %27 to i32
  %spec.select.4 = add nuw nsw i32 %spec.select.3, %28
  %29 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @_QFEc, i64 0, i64 5), align 4, !tbaa !3
  %30 = icmp sgt i32 %29, 0
  %31 = zext i1 %30 to i32
  %spec.select.5 = add nuw nsw i32 %spec.select.4, %31
  %32 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @_QFEc, i64 0, i64 6), align 8, !tbaa !3
  %33 = icmp sgt i32 %32, 0
  %34 = zext i1 %33 to i32
  %spec.select.6 = add nuw nsw i32 %spec.select.5, %34
  %35 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @_QFEc, i64 0, i64 7), align 4, !tbaa !3
  %36 = icmp sgt i32 %35, 0
  %37 = zext i1 %36 to i32
  %spec.select.7 = add nuw nsw i32 %spec.select.6, %37
  %38 = icmp eq i32 %spec.select.7, 0
  br i1 %38, label %47, label %51

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %39 = add nsw i64 %indvars.iv, -1
  %40 = getelementptr [100 x i32], ptr @_QFEa, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !3
  %42 = sdiv i32 %41, 400
  %spec.store.select = call i32 @llvm.smin.i32(i32 %42, i32 8)
  %43 = sext i32 %spec.store.select to i64
  %44 = getelementptr [9 x i32], ptr @_QFEc, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !3
  %46 = add i32 %45, 1
  store i32 %46, ptr %44, align 4, !tbaa !3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %13
  br i1 %exitcond.not, label %.preheader, label %.lr.ph

47:                                               ; preds = %.preheader
  %48 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.2869302C782C693029, i64 9, ptr null, i32 -1, ptr nonnull @_QQcl.9698778f54bc51754a25226305821c92, i32 18)
  %49 = call i1 @_FortranAioOutputInteger32(ptr %48, i32 1)
  %50 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @_QFEc, i64 0, i64 8), align 16, !tbaa !3
  br label %56

51:                                               ; preds = %.preheader
  %52 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.2869302C782C693029, i64 9, ptr null, i32 -1, ptr nonnull @_QQcl.9698778f54bc51754a25226305821c92, i32 20)
  %53 = call i1 @_FortranAioOutputInteger32(ptr %52, i32 %spec.select.7)
  %54 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @_QFEc, i64 0, i64 8), align 16, !tbaa !3
  %55 = add i32 %54, %spec.select.7
  br label %56

56:                                               ; preds = %47, %51
  %.sink22 = phi i32 [ %50, %47 ], [ %55, %51 ]
  %.sink21 = phi ptr [ %48, %47 ], [ %52, %51 ]
  %57 = call i1 @_FortranAioOutputInteger32(ptr %.sink21, i32 %.sink22)
  %58 = call i32 @_FortranAioEndIoStatement(ptr %.sink21)
  %59 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, 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.smax.i32(i32, i32) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { noreturn }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
