import java.util.*;
public class Main{
    public static void main(String[] args) {
        setTest();
    }
    public static void setTest() {
        Set<Integer> tmpSet = new HashSet<>();
        Set<Integer> collect = new HashSet<>();
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 0; i <= n; i++) {
            collect.add(i);
        }
        for (int i = 0; i < n; i++) {
            int item = scanner.nextInt();
            tmpSet.add(item);
        }

        collect.removeAll(tmpSet);
        collect.stream().forEach(System.out::println);
    }
}