n = int(input()) a = [int(x) for x in input().split()] t = set(a) al = len(a) tl = len(t) if n == 1: print(1) elif tl == 1: print(0) elif al == tl: print(al) else: print(al-tl)