package yukicoder; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] args) { BufferedReader read = new BufferedReader(new InputStreamReader(System.in)); try { int N = Integer.parseInt(read.readLine()); String[] line = read.readLine().split(" "); List list = new ArrayList<>(N); list.add(0); for (int i = 0; i < N; ++i) { list.add(Integer.parseInt(line[i])); } list.add(Integer.MAX_VALUE); list.sort(null); int ans = 0; for (int i = 1; i <= N; ++i) { if (list.get(i - 1).intValue() != list.get(i).intValue() && list.get(i + 1).intValue() != list.get(i).intValue()) { ++ans; } } System.out.println(ans); } catch (Exception e) { e.printStackTrace(); } } }