
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[n];
        for(int i=0;i<n;i++){
            ints[i]=scanner.nextInt();
        }
        int result=selectionSort(ints);
        for(int i=0;i<ints.length;i++){
            System.out.print(ints[i]);
            if(i!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println();
        System.out.println(result);
    }
    public static int selectionSort(int[] ints){
        int result=0;
        for(int i=0;i<ints.length;i++){
            int minj=i;
            for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            }
            if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            }
        }
        return result;
    }

}
 import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[n];
        for(int i=0;i<n;i++){
            ints[i]=scanner.nextInt();
        }
        int result=selectionSort(ints);
        for(int i=0;i<ints.length;i++){
            System.out.print(ints[i]);
            if(i!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println();
        System.out.println(result);
    }
    public static int selectionSort(int[] ints){
        int result=0;
        for(int i=0;i<ints.length;i++){
            int minj=i;
            for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            }
            if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            }
        }
        return result;
    }

} Main public static void main(String[] args) {
        // write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[n];
        for(int i=0;i<n;i++){
            ints[i]=scanner.nextInt();
        }
        int result=selectionSort(ints);
        for(int i=0;i<ints.length;i++){
            System.out.print(ints[i]);
            if(i!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println();
        System.out.println(result);
    } main {
        // write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[n];
        for(int i=0;i<n;i++){
            ints[i]=scanner.nextInt();
        }
        int result=selectionSort(ints);
        for(int i=0;i<ints.length;i++){
            System.out.print(ints[i]);
            if(i!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println();
        System.out.println(result);
    } Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) int n=scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int[] ints=new int[n]; ints new int[n] n for(int i=0;i<n;i++){
            ints[i]=scanner.nextInt();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            ints[i]=scanner.nextInt();
        } {
            ints[i]=scanner.nextInt();
        } ints[i]=scanner.nextInt() ints[i] ints i scanner.nextInt() scanner.nextInt scanner int result=selectionSort(ints); result selectionSort(ints) selectionSort ints for(int i=0;i<ints.length;i++){
            System.out.print(ints[i]);
            if(i!=ints.length-1){
                System.out.print(" ");
            }
        } int i=0; int i=0; i 0 i<ints.length i ints.length ints ints.length i++ i++ i {
            System.out.print(ints[i]);
            if(i!=ints.length-1){
                System.out.print(" ");
            }
        } {
            System.out.print(ints[i]);
            if(i!=ints.length-1){
                System.out.print(" ");
            }
        } System.out.print(ints[i]) System.out.print System.out System System.out ints[i] ints i if(i!=ints.length-1){
                System.out.print(" ");
            } i!=ints.length-1 i ints.length-1 ints.length ints ints.length 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 System.out.println(result) System.out.println System.out System System.out result String[] args args public static int selectionSort(int[] ints){
        int result=0;
        for(int i=0;i<ints.length;i++){
            int minj=i;
            for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            }
            if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            }
        }
        return result;
    } selectionSort {
        int result=0;
        for(int i=0;i<ints.length;i++){
            int minj=i;
            for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            }
            if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            }
        }
        return result;
    } int result=0; result 0 for(int i=0;i<ints.length;i++){
            int minj=i;
            for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            }
            if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            }
        } int i=0; int i=0; i 0 i<ints.length i ints.length ints ints.length i++ i++ i {
            int minj=i;
            for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            }
            if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            }
        } {
            int minj=i;
            for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            }
            if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            }
        } int minj=i; minj i for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            } int j=i; int j=i; j i j<ints.length j ints.length ints ints.length j++ j++ j {
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            } {
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            } if(ints[j]<ints[minj]){
                    minj=j;
                } ints[j]<ints[minj] ints[j] ints j ints[minj] ints minj {
                    minj=j;
                } minj=j minj j if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            } i!=minj i minj {
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            } result++ result int tmp=ints[i]; tmp ints[i] ints i ints[i]=ints[minj] ints[i] ints i ints[minj] ints minj ints[minj]=tmp ints[minj] ints minj tmp return result; result int[] ints ints public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[n];
        for(int i=0;i<n;i++){
            ints[i]=scanner.nextInt();
        }
        int result=selectionSort(ints);
        for(int i=0;i<ints.length;i++){
            System.out.print(ints[i]);
            if(i!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println();
        System.out.println(result);
    }
    public static int selectionSort(int[] ints){
        int result=0;
        for(int i=0;i<ints.length;i++){
            int minj=i;
            for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            }
            if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            }
        }
        return result;
    }

} public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[n];
        for(int i=0;i<n;i++){
            ints[i]=scanner.nextInt();
        }
        int result=selectionSort(ints);
        for(int i=0;i<ints.length;i++){
            System.out.print(ints[i]);
            if(i!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println();
        System.out.println(result);
    }
    public static int selectionSort(int[] ints){
        int result=0;
        for(int i=0;i<ints.length;i++){
            int minj=i;
            for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            }
            if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            }
        }
        return result;
    }

} Main

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] ints=new int[n];
        for(int i=0;i<n;i++){
            ints[i]=scanner.nextInt();
        }
        int result=selectionSort(ints);
        for(int i=0;i<ints.length;i++){
            System.out.print(ints[i]);
            if(i!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println();
        System.out.println(result);
    }
    public static int selectionSort(int[] ints){
        int result=0;
        for(int i=0;i<ints.length;i++){
            int minj=i;
            for(int j=i;j<ints.length;j++){
                if(ints[j]<ints[minj]){
                    minj=j;
                }
            }
            if(i!=minj){
                result++;
                int tmp=ints[i];
                ints[i]=ints[minj];
                ints[minj]=tmp;
            }
        }
        return result;
    }

}

