import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);    
        int N=0;
        N = sc.nextInt();
        int[] A;
        A = new int[N];
        int count=0;
        for(count=0;count<N;count++){
            A[count] = sc.nextInt();
        }
        
        int i;
        int j;
        int minj;
        int z=0;
        int swap=0;
        for(i=0;i<N;i++){
            minj = i;
            for(j=i;j<N;j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                z = A[i];
                A[i] = A[minj];
                A[minj] = z;
                swap++;
            }
        }

        for(i=0;i<N-1;i++){
            System.out.print(A[i]+" ");
        }
        System.out.println(A[N-1]);
        System.out.println(swap);   
        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);    
        int N=0;
        N = sc.nextInt();
        int[] A;
        A = new int[N];
        int count=0;
        for(count=0;count<N;count++){
            A[count] = sc.nextInt();
        }
        
        int i;
        int j;
        int minj;
        int z=0;
        int swap=0;
        for(i=0;i<N;i++){
            minj = i;
            for(j=i;j<N;j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                z = A[i];
                A[i] = A[minj];
                A[minj] = z;
                swap++;
            }
        }

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

        for(i=0;i<N-1;i++){
            System.out.print(A[i]+" ");
        }
        System.out.println(A[N-1]);
        System.out.println(swap);   
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);    
        int N=0;
        N = sc.nextInt();
        int[] A;
        A = new int[N];
        int count=0;
        for(count=0;count<N;count++){
            A[count] = sc.nextInt();
        }
        
        int i;
        int j;
        int minj;
        int z=0;
        int swap=0;
        for(i=0;i<N;i++){
            minj = i;
            for(j=i;j<N;j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                z = A[i];
                A[i] = A[minj];
                A[minj] = z;
                swap++;
            }
        }

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

        for(i=0;i<N-1;i++){
            System.out.print(A[i]+" ");
        }
        System.out.println(A[N-1]);
        System.out.println(swap);   
        sc.close();
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);    
        int N=0;
        N = sc.nextInt();
        int[] A;
        A = new int[N];
        int count=0;
        for(count=0;count<N;count++){
            A[count] = sc.nextInt();
        }
        
        int i;
        int j;
        int minj;
        int z=0;
        int swap=0;
        for(i=0;i<N;i++){
            minj = i;
            for(j=i;j<N;j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                z = A[i];
                A[i] = A[minj];
                A[minj] = z;
                swap++;
            }
        }

        for(i=0;i<N-1;i++){
            System.out.print(A[i]+" ");
        }
        System.out.println(A[N-1]);
        System.out.println(swap);   
        sc.close();
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);    
        int N=0;
        N = sc.nextInt();
        int[] A;
        A = new int[N];
        int count=0;
        for(count=0;count<N;count++){
            A[count] = sc.nextInt();
        }
        
        int i;
        int j;
        int minj;
        int z=0;
        int swap=0;
        for(i=0;i<N;i++){
            minj = i;
            for(j=i;j<N;j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                z = A[i];
                A[i] = A[minj];
                A[minj] = z;
                swap++;
            }
        }

        for(i=0;i<N-1;i++){
            System.out.print(A[i]+" ");
        }
        System.out.println(A[N-1]);
        System.out.println(swap);   
        sc.close();
    }
}
