import java.util.Scanner; public class Main { private final static Main main = new Main(); public static void main(String[] args) { long l = System.currentTimeMillis(); main.solve(); //System.out.println("処理時間:" + (System.currentTimeMillis() - l)); } private void solve() { Scanner sc = new Scanner(System.in); sc.nextLine(); String s = sc.nextLine(); String[] list = s.split(" "); int ans = 0; for(String number : list) { int index = s.indexOf(number); if(index == -1) { continue; } if(index != s.lastIndexOf(number)) { s = s.replace(number, "NULL"); } else { ++ans; } } System.out.println(ans); } }