#coding: UTF-8 import sys import re import itertools from math import log from collections import deque ### defs ### ### main ### N = int(sys.stdin.readline()) A = list(map(int, sys.stdin.readline().split())) sorted(A) A = [0] + A + [0] ans=0 for i in range(1,N+1): if (A[i-1]!=A[i] and A[i]!=A[i+1]): ans+=1 print(ans)