#include <stdio.h>
#include <stdlib.h>
int compare(const void *a,const void *b){
	return *(int*)a-*(int*)b;
}
int main(){
	int n,i,r=1,t;
	int arr[999];
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d",arr+i);
	qsort(arr,n,4,compare);
	t=arr[0];
	for(i=1;i<n;i++){
		if(t!=arr[i]){
			t=arr[i];
			r++;
		}
	}
	printf("%d\n",r);
	return 0;
}

; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_628/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_628/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 [4 x i8] c"%d\0A\00", align 1

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
  %0 = load i32, ptr %a, align 4, !tbaa !5
  %1 = load i32, ptr %b, align 4, !tbaa !5
  %sub = sub nsw i32 %0, %1
  ret i32 %sub
}

; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
  %n = alloca i32, align 4
  %arr = alloca [999 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
  call void @llvm.lifetime.start.p0(i64 3996, ptr nonnull %arr) #6
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
  %0 = load i32, ptr %n, align 4, !tbaa !5
  %cmp26 = icmp sgt i32 %0, 0
  br i1 %cmp26, label %for.body, label %entry.for.end_crit_edge

entry.for.end_crit_edge:                          ; preds = %entry
  %.pre = sext i32 %0 to i64
  br label %for.end

for.body:                                         ; preds = %entry, %for.body
  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
  %add.ptr = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
  %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %1 = load i32, ptr %n, align 4, !tbaa !5
  %2 = sext i32 %1 to i64
  %cmp = icmp slt i64 %indvars.iv.next, %2
  br i1 %cmp, label %for.body, label %for.end

for.end:                                          ; preds = %for.body, %entry.for.end_crit_edge
  %conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
  call void @qsort(ptr noundef nonnull %arr, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare) #6
  %3 = load i32, ptr %n, align 4, !tbaa !5
  %cmp428 = icmp sgt i32 %3, 1
  br i1 %cmp428, label %for.body6.preheader, label %for.end15

for.body6.preheader:                              ; preds = %for.end
  %4 = load i32, ptr %arr, align 16, !tbaa !5
  %wide.trip.count = zext i32 %3 to i64
  %5 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i32 %3, 9
  br i1 %min.iters.check, label %for.body6.preheader40, label %vector.ph

vector.ph:                                        ; preds = %for.body6.preheader
  %n.vec = and i64 %5, -8
  %ind.end = or i64 %n.vec, 1
  %vector.recur.init = insertelement <4 x i32> poison, i32 %4, i64 3
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load39, %vector.body ]
  %vec.phi = phi <4 x i32> [ <i32 1, i32 0, i32 0, i32 0>, %vector.ph ], [ %14, %vector.body ]
  %vec.phi38 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
  %offset.idx = or i64 %index, 1
  %6 = getelementptr inbounds [999 x i32], ptr %arr, i64 0, i64 %offset.idx
  %wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
  %7 = getelementptr inbounds i32, ptr %6, i64 4
  %wide.load39 = load <4 x i32>, ptr %7, align 4, !tbaa !5
  %8 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %9 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load39, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %10 = icmp ne <4 x i32> %8, %wide.load
  %11 = icmp ne <4 x i32> %9, %wide.load39
  %12 = zext <4 x i1> %10 to <4 x i32>
  %13 = zext <4 x i1> %11 to <4 x i32>
  %14 = add <4 x i32> %vec.phi, %12
  %15 = add <4 x i32> %vec.phi38, %13
  %index.next = add nuw i64 %index, 8
  %16 = icmp eq i64 %index.next, %n.vec
  br i1 %16, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %15, %14
  %17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %5, %n.vec
  %vector.recur.extract = extractelement <4 x i32> %wide.load39, i64 3
  br i1 %cmp.n, label %for.end15, label %for.body6.preheader40

for.body6.preheader40:                            ; preds = %for.body6.preheader, %middle.block
  %indvars.iv35.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body6.preheader ]
  %scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %4, %for.body6.preheader ]
  %r.030.ph = phi i32 [ %17, %middle.block ], [ 1, %for.body6.preheader ]
  br label %for.body6

for.body6:                                        ; preds = %for.body6.preheader40, %for.body6
  %indvars.iv35 = phi i64 [ %indvars.iv.next36, %for.body6 ], [ %indvars.iv35.ph, %for.body6.preheader40 ]
  %scalar.recur = phi i32 [ %18, %for.body6 ], [ %scalar.recur.ph, %for.body6.preheader40 ]
  %r.030 = phi i32 [ %spec.select, %for.body6 ], [ %r.030.ph, %for.body6.preheader40 ]
  %arrayidx7 = getelementptr inbounds [999 x i32], ptr %arr, i64 0, i64 %indvars.iv35
  %18 = load i32, ptr %arrayidx7, align 4, !tbaa !5
  %cmp8.not = icmp ne i32 %scalar.recur, %18
  %inc12 = zext i1 %cmp8.not to i32
  %spec.select = add nuw nsw i32 %r.030, %inc12
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next36, %wide.trip.count
  br i1 %exitcond.not, label %for.end15, label %for.body6, !llvm.loop !12

for.end15:                                        ; preds = %for.body6, %middle.block, %for.end
  %r.0.lcssa = phi i32 [ 1, %for.end ], [ %17, %middle.block ], [ %spec.select, %for.body6 ]
  %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.0.lcssa)
  call void @llvm.lifetime.end.p0(i64 3996, ptr nonnull %arr) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
  ret i32 0
}

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

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

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) 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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nofree "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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !11, !10}
