#import <stdio.h>
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
int main(){
    int N;
    scanf("%d", &N);
    int C[9] = {0};
    for(int i=0;i<N;i++){
        int a;
        scanf("%d", &a);
        C[MIN(a/400,8)]++;
    }
    int count=0;
    for(int i=0;i<8;i++){
        if(C[i]>0) count++;
    }
    printf("%d %d", MAX(count,1), count+C[8]);
}

; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_767/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_767/source.m"
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"

@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1

; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
  %N = alloca i32, align 4
  %C = alloca [9 x i32], align 16
  %a = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %C) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) %C, i8 0, i64 36, i1 false)
  %0 = load i32, ptr %N, align 4, !tbaa !5
  %cmp30 = icmp sgt i32 %0, 0
  br i1 %cmp30, label %for.body, label %for.cond6.preheader

for.cond6.preheader.loopexit:                     ; preds = %for.body
  %arrayidx22.phi.trans.insert = getelementptr inbounds [9 x i32], ptr %C, i64 0, i64 8
  %.pre42 = load i32, ptr %arrayidx22.phi.trans.insert, align 16, !tbaa !5
  %1 = load <8 x i32>, ptr %C, align 16, !tbaa !5
  %2 = icmp sgt <8 x i32> %1, zeroinitializer
  %3 = bitcast <8 x i1> %2 to i8
  %4 = call i8 @llvm.ctpop.i8(i8 %3), !range !9
  %5 = zext i8 %4 to i32
  br label %for.cond6.preheader

for.cond6.preheader:                              ; preds = %for.cond6.preheader.loopexit, %entry
  %6 = phi i32 [ %.pre42, %for.cond6.preheader.loopexit ], [ 0, %entry ]
  %spec.select.7 = phi i32 [ %5, %for.cond6.preheader.loopexit ], [ 0, %entry ]
  %cond21 = call i32 @llvm.smax.i32(i32 %spec.select.7, i32 1)
  %add = add nsw i32 %6, %spec.select.7
  %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond21, i32 noundef %add)
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %C) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
  ret i32 0

for.body:                                         ; preds = %entry, %for.body
  %i.031 = phi i32 [ %inc4, %for.body ], [ 0, %entry ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
  %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
  %7 = load i32, ptr %a, align 4, !tbaa !5
  %cmp2 = icmp slt i32 %7, 3200
  %div = sdiv i32 %7, 400
  %cond = select i1 %cmp2, i32 %div, i32 8
  %idxprom = sext i32 %cond to i64
  %arrayidx = getelementptr inbounds [9 x i32], ptr %C, i64 0, i64 %idxprom
  %8 = load i32, ptr %arrayidx, align 4, !tbaa !5
  %inc = add nsw i32 %8, 1
  store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
  %inc4 = add nuw nsw i32 %i.031, 1
  %9 = load i32, ptr %N, align 4, !tbaa !5
  %cmp = icmp slt i32 %inc4, %9
  br i1 %cmp, label %for.body, label %for.cond6.preheader.loopexit
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.ctpop.i8(i8) #4

attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

!llvm.linker.options = !{}
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i8 0, i8 9}
