import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;

public class Monsters {

    public static void main(String[] args) {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s;
        try {
            while ((s = br.readLine()) != null && !s.isEmpty()) {
                HashMap<Integer, Integer> hashMap = new HashMap<>();
                int swaps = 0;

                int n = Integer.parseInt(s);
                int[] arr = new int[n];
                String[] sep = br.readLine().split(" ");

                for (int i = 0; i < sep.length; i++) {
                    arr[i] = Integer.parseInt(sep[i]);
                    hashMap.put(arr[i], i);
                }

                for (int i = 0; i < arr.length; i++) {
                    if (arr[i] != i + 1) {
                        swaps++;
                        int tmp = arr[i];
                        arr[i] = i + 1;
                        arr[hashMap.get(i + 1)] = tmp;
                        hashMap.replace(tmp, hashMap.get(i + 1));
                    }
                }

                System.out.println(swaps);
            }
        }catch (IOException e) {
            e.printStackTrace();
        }


    }

}
