import java.io.*;
import java.util.*;



public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
                    
        str = br.readLine();
        int N = Integer.parseInt(str);
        str = br.readLine();
        String[] strs = str.split("\\s");
        int[] A = new int[N];
        for(int i=0;i<N;i++){
            A[i] = Integer.parseInt(strs[i]);
        }

        int count = 0;
        for(int i=0; i<N; i++){
            int minj = i;
            for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            }
        }

        StringBuilder sb = new StringBuilder();
        for(int i=0;i<N;i++){
            sb.append(A[i]);
            if(i != N-1){
                sb.append(" ");
            }
        }
        sb.append("\n");
        sb.append(count);

        System.out.println(sb.toString());

        br.close();
    }

    
} import java.io.*; io.* java import java.util.*; util.* java public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
                    
        str = br.readLine();
        int N = Integer.parseInt(str);
        str = br.readLine();
        String[] strs = str.split("\\s");
        int[] A = new int[N];
        for(int i=0;i<N;i++){
            A[i] = Integer.parseInt(strs[i]);
        }

        int count = 0;
        for(int i=0; i<N; i++){
            int minj = i;
            for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            }
        }

        StringBuilder sb = new StringBuilder();
        for(int i=0;i<N;i++){
            sb.append(A[i]);
            if(i != N-1){
                sb.append(" ");
            }
        }
        sb.append("\n");
        sb.append(count);

        System.out.println(sb.toString());

        br.close();
    }

    
} Main public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
                    
        str = br.readLine();
        int N = Integer.parseInt(str);
        str = br.readLine();
        String[] strs = str.split("\\s");
        int[] A = new int[N];
        for(int i=0;i<N;i++){
            A[i] = Integer.parseInt(strs[i]);
        }

        int count = 0;
        for(int i=0; i<N; i++){
            int minj = i;
            for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            }
        }

        StringBuilder sb = new StringBuilder();
        for(int i=0;i<N;i++){
            sb.append(A[i]);
            if(i != N-1){
                sb.append(" ");
            }
        }
        sb.append("\n");
        sb.append(count);

        System.out.println(sb.toString());

        br.close();
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
                    
        str = br.readLine();
        int N = Integer.parseInt(str);
        str = br.readLine();
        String[] strs = str.split("\\s");
        int[] A = new int[N];
        for(int i=0;i<N;i++){
            A[i] = Integer.parseInt(strs[i]);
        }

        int count = 0;
        for(int i=0; i<N; i++){
            int minj = i;
            for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            }
        }

        StringBuilder sb = new StringBuilder();
        for(int i=0;i<N;i++){
            sb.append(A[i]);
            if(i != N-1){
                sb.append(" ");
            }
        }
        sb.append("\n");
        sb.append(count);

        System.out.println(sb.toString());

        br.close();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str; str str = br.readLine() str br.readLine() br.readLine br int N = Integer.parseInt(str); N Integer.parseInt(str) Integer.parseInt Integer str str = br.readLine() str br.readLine() br.readLine br String[] strs = str.split("\\s"); strs str.split("\\s") str.split str "\\s" int[] A = new int[N]; A new int[N] N for(int i=0;i<N;i++){
            A[i] = Integer.parseInt(strs[i]);
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            A[i] = Integer.parseInt(strs[i]);
        } {
            A[i] = Integer.parseInt(strs[i]);
        } A[i] = Integer.parseInt(strs[i]) A[i] A i Integer.parseInt(strs[i]) Integer.parseInt Integer strs[i] strs i int count = 0; count 0 for(int i=0; i<N; i++){
            int minj = i;
            for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            int minj = i;
            for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            }
        } {
            int minj = i;
            for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            }
        } int minj = i; minj i for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            } int j= i; int j= i; j i j<N j N j++ j++ j {
                if(A[j] < A[minj]){
                    minj = j;
                }
            } {
                if(A[j] < A[minj]){
                    minj = j;
                }
            } if(A[j] < A[minj]){
                    minj = j;
                } A[j] < A[minj] A[j] A j A[minj] A minj {
                    minj = j;
                } minj = j minj j if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            } i != minj i minj {
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            } int temp = A[i]; temp A[i] A i A[i] = A[minj] A[i] A i A[minj] A minj A[minj] = temp A[minj] A minj temp count++ count StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i=0;i<N;i++){
            sb.append(A[i]);
            if(i != N-1){
                sb.append(" ");
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            sb.append(A[i]);
            if(i != N-1){
                sb.append(" ");
            }
        } {
            sb.append(A[i]);
            if(i != N-1){
                sb.append(" ");
            }
        } sb.append(A[i]) sb.append sb A[i] A i if(i != N-1){
                sb.append(" ");
            } i != N-1 i N-1 N 1 {
                sb.append(" ");
            } sb.append(" ") sb.append sb " " sb.append("\n") sb.append sb "\n" sb.append(count) sb.append sb count System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb br.close() br.close br String[] args args public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
                    
        str = br.readLine();
        int N = Integer.parseInt(str);
        str = br.readLine();
        String[] strs = str.split("\\s");
        int[] A = new int[N];
        for(int i=0;i<N;i++){
            A[i] = Integer.parseInt(strs[i]);
        }

        int count = 0;
        for(int i=0; i<N; i++){
            int minj = i;
            for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            }
        }

        StringBuilder sb = new StringBuilder();
        for(int i=0;i<N;i++){
            sb.append(A[i]);
            if(i != N-1){
                sb.append(" ");
            }
        }
        sb.append("\n");
        sb.append(count);

        System.out.println(sb.toString());

        br.close();
    }

    
} public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
                    
        str = br.readLine();
        int N = Integer.parseInt(str);
        str = br.readLine();
        String[] strs = str.split("\\s");
        int[] A = new int[N];
        for(int i=0;i<N;i++){
            A[i] = Integer.parseInt(strs[i]);
        }

        int count = 0;
        for(int i=0; i<N; i++){
            int minj = i;
            for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            }
        }

        StringBuilder sb = new StringBuilder();
        for(int i=0;i<N;i++){
            sb.append(A[i]);
            if(i != N-1){
                sb.append(" ");
            }
        }
        sb.append("\n");
        sb.append(count);

        System.out.println(sb.toString());

        br.close();
    }

    
} Main
import java.io.*;
import java.util.*;



public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
                    
        str = br.readLine();
        int N = Integer.parseInt(str);
        str = br.readLine();
        String[] strs = str.split("\\s");
        int[] A = new int[N];
        for(int i=0;i<N;i++){
            A[i] = Integer.parseInt(strs[i]);
        }

        int count = 0;
        for(int i=0; i<N; i++){
            int minj = i;
            for(int j= i; j<N; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if( i != minj){
                int temp = A[i];
                A[i] = A[minj];
                A[minj] = temp;
                count++;
            }
        }

        StringBuilder sb = new StringBuilder();
        for(int i=0;i<N;i++){
            sb.append(A[i]);
            if(i != N-1){
                sb.append(" ");
            }
        }
        sb.append("\n");
        sb.append(count);

        System.out.println(sb.toString());

        br.close();
    }

    
}
