import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A;
        A = new int[n];
        int count = 0;
        for(int i=0;i<n;++i){
            A[i] = sc.nextInt();
        }


        int minj;
        for(int i=0;i<n-1;++i){  //selectionsort
            minj = i;
            for(int j=i;j<n;++j){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i!=minj){
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            }
        }

        print(A, n);
        System.out.println(count);
    }

    public static void print(int A[], int n){
        for(int i=0;i<n;++i){
            System.out.print(A[i]);
            if(i<n-1){System.out.print(" ");}
        }
        System.out.println();
    }
}
 import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A;
        A = new int[n];
        int count = 0;
        for(int i=0;i<n;++i){
            A[i] = sc.nextInt();
        }


        int minj;
        for(int i=0;i<n-1;++i){  //selectionsort
            minj = i;
            for(int j=i;j<n;++j){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i!=minj){
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            }
        }

        print(A, n);
        System.out.println(count);
    }

    public static void print(int A[], int n){
        for(int i=0;i<n;++i){
            System.out.print(A[i]);
            if(i<n-1){System.out.print(" ");}
        }
        System.out.println();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A;
        A = new int[n];
        int count = 0;
        for(int i=0;i<n;++i){
            A[i] = sc.nextInt();
        }


        int minj;
        for(int i=0;i<n-1;++i){  //selectionsort
            minj = i;
            for(int j=i;j<n;++j){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i!=minj){
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            }
        }

        print(A, n);
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A;
        A = new int[n];
        int count = 0;
        for(int i=0;i<n;++i){
            A[i] = sc.nextInt();
        }


        int minj;
        for(int i=0;i<n-1;++i){  //selectionsort
            minj = i;
            for(int j=i;j<n;++j){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i!=minj){
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            }
        }

        print(A, n);
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] A; A A = new int[n] A new int[n] n int count = 0; count 0 for(int i=0;i<n;++i){
            A[i] = sc.nextInt();
        } int i=0; int i=0; i 0 i<n i n ++i ++i i {
            A[i] = sc.nextInt();
        } {
            A[i] = sc.nextInt();
        } A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc int minj; minj for(int i=0;i<n-1;++i){  //selectionsort
            minj = i;
            for(int j=i;j<n;++j){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i!=minj){
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            }
        } int i=0; int i=0; i 0 i<n-1 i n-1 n 1 ++i ++i i {  //selectionsort
            minj = i;
            for(int j=i;j<n;++j){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i!=minj){
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            }
        } {  //selectionsort
            minj = i;
            for(int j=i;j<n;++j){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i!=minj){
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            }
        } 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 c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            } i!=minj i minj {
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            } int c; c c = A[i] c A[i] A i A[i] = A[minj] A[i] A i A[minj] A minj A[minj] = c A[minj] A minj c count++ count print(A, n) print A n System.out.println(count) System.out.println System.out System System.out count String[] args args public static void print(int A[], int n){
        for(int i=0;i<n;++i){
            System.out.print(A[i]);
            if(i<n-1){System.out.print(" ");}
        }
        System.out.println();
    } print {
        for(int i=0;i<n;++i){
            System.out.print(A[i]);
            if(i<n-1){System.out.print(" ");}
        }
        System.out.println();
    } for(int i=0;i<n;++i){
            System.out.print(A[i]);
            if(i<n-1){System.out.print(" ");}
        } int i=0; int i=0; i 0 i<n i n ++i ++i i {
            System.out.print(A[i]);
            if(i<n-1){System.out.print(" ");}
        } {
            System.out.print(A[i]);
            if(i<n-1){System.out.print(" ");}
        } System.out.print(A[i]) System.out.print System.out System System.out A[i] A i if(i<n-1){System.out.print(" ");} i<n-1 i n-1 n 1 {System.out.print(" ");} System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out int A[] A int n n public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A;
        A = new int[n];
        int count = 0;
        for(int i=0;i<n;++i){
            A[i] = sc.nextInt();
        }


        int minj;
        for(int i=0;i<n-1;++i){  //selectionsort
            minj = i;
            for(int j=i;j<n;++j){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i!=minj){
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            }
        }

        print(A, n);
        System.out.println(count);
    }

    public static void print(int A[], int n){
        for(int i=0;i<n;++i){
            System.out.print(A[i]);
            if(i<n-1){System.out.print(" ");}
        }
        System.out.println();
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A;
        A = new int[n];
        int count = 0;
        for(int i=0;i<n;++i){
            A[i] = sc.nextInt();
        }


        int minj;
        for(int i=0;i<n-1;++i){  //selectionsort
            minj = i;
            for(int j=i;j<n;++j){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i!=minj){
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            }
        }

        print(A, n);
        System.out.println(count);
    }

    public static void print(int A[], int n){
        for(int i=0;i<n;++i){
            System.out.print(A[i]);
            if(i<n-1){System.out.print(" ");}
        }
        System.out.println();
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A;
        A = new int[n];
        int count = 0;
        for(int i=0;i<n;++i){
            A[i] = sc.nextInt();
        }


        int minj;
        for(int i=0;i<n-1;++i){  //selectionsort
            minj = i;
            for(int j=i;j<n;++j){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i!=minj){
                int c;
                c = A[i];
                A[i] = A[minj];
                A[minj] = c;
                count++;
            }
        }

        print(A, n);
        System.out.println(count);
    }

    public static void print(int A[], int n){
        for(int i=0;i<n;++i){
            System.out.print(A[i]);
            if(i<n-1){System.out.print(" ");}
        }
        System.out.println();
    }
}

