import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int A[] = new int[100];
        int N = sc.nextInt();
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
        }
        int flag = 1, t, minj = 0, change = 0;
        boolean dif = false;
        for(int i=0; i<=N-1; i++){
            minj = i;
            for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } 
            t = A[i];
            A[i] = A[minj];
            A[minj] = t;
            if(dif){
                change++;
                dif = false;
            }
        }
        for(int j=0; j<N; j++)  {
            System.out.print(A[j]);
            if(j != N-1) System.out.print(" ");
        }
        System.out.println("\n" + change);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int A[] = new int[100];
        int N = sc.nextInt();
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
        }
        int flag = 1, t, minj = 0, change = 0;
        boolean dif = false;
        for(int i=0; i<=N-1; i++){
            minj = i;
            for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } 
            t = A[i];
            A[i] = A[minj];
            A[minj] = t;
            if(dif){
                change++;
                dif = false;
            }
        }
        for(int j=0; j<N; j++)  {
            System.out.print(A[j]);
            if(j != N-1) System.out.print(" ");
        }
        System.out.println("\n" + change);
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int A[] = new int[100];
        int N = sc.nextInt();
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
        }
        int flag = 1, t, minj = 0, change = 0;
        boolean dif = false;
        for(int i=0; i<=N-1; i++){
            minj = i;
            for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } 
            t = A[i];
            A[i] = A[minj];
            A[minj] = t;
            if(dif){
                change++;
                dif = false;
            }
        }
        for(int j=0; j<N; j++)  {
            System.out.print(A[j]);
            if(j != N-1) System.out.print(" ");
        }
        System.out.println("\n" + change);
    } main {
        Scanner sc = new Scanner(System.in);
        int A[] = new int[100];
        int N = sc.nextInt();
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
        }
        int flag = 1, t, minj = 0, change = 0;
        boolean dif = false;
        for(int i=0; i<=N-1; i++){
            minj = i;
            for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } 
            t = A[i];
            A[i] = A[minj];
            A[minj] = t;
            if(dif){
                change++;
                dif = false;
            }
        }
        for(int j=0; j<N; j++)  {
            System.out.print(A[j]);
            if(j != N-1) System.out.print(" ");
        }
        System.out.println("\n" + change);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A[] = new int[100]; A new int[100] 100 int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc 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 flag = 1 flag 1 t t minj = 0 minj 0 change = 0; change 0 boolean dif = false; dif false for(int i=0; i<=N-1; i++){
            minj = i;
            for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } 
            t = A[i];
            A[i] = A[minj];
            A[minj] = t;
            if(dif){
                change++;
                dif = false;
            }
        } int i=0; int i=0; i 0 i<=N-1 i N-1 N 1 i++ i++ i {
            minj = i;
            for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } 
            t = A[i];
            A[i] = A[minj];
            A[minj] = t;
            if(dif){
                change++;
                dif = false;
            }
        } {
            minj = i;
            for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } 
            t = A[i];
            A[i] = A[minj];
            A[minj] = t;
            if(dif){
                change++;
                dif = false;
            }
        } minj = i minj i for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } int j=i; int j=i; j i j<=N-1 j N-1 N 1 j++ j++ j {
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } {
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                } A[j] < A[minj] A[j] A j A[minj] A minj {
                    minj = j;
                    dif = true;
                } minj = j minj j dif = true dif true t = A[i] t A[i] A i A[i] = A[minj] A[i] A i A[minj] A minj A[minj] = t A[minj] A minj t if(dif){
                change++;
                dif = false;
            } dif {
                change++;
                dif = false;
            } change++ change dif = false dif false for(int j=0; j<N; j++)  {
            System.out.print(A[j]);
            if(j != N-1) System.out.print(" ");
        } int j=0; int j=0; j 0 j<N j N j++ j++ j {
            System.out.print(A[j]);
            if(j != N-1) System.out.print(" ");
        } {
            System.out.print(A[j]);
            if(j != N-1) System.out.print(" ");
        } System.out.print(A[j]) System.out.print System.out System System.out A[j] A j if(j != N-1) System.out.print(" "); j != N-1 j N-1 N 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println("\n" + change) System.out.println System.out System System.out "\n" + change "\n" change String args[] args public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int A[] = new int[100];
        int N = sc.nextInt();
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
        }
        int flag = 1, t, minj = 0, change = 0;
        boolean dif = false;
        for(int i=0; i<=N-1; i++){
            minj = i;
            for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } 
            t = A[i];
            A[i] = A[minj];
            A[minj] = t;
            if(dif){
                change++;
                dif = false;
            }
        }
        for(int j=0; j<N; j++)  {
            System.out.print(A[j]);
            if(j != N-1) System.out.print(" ");
        }
        System.out.println("\n" + change);
    }
} public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int A[] = new int[100];
        int N = sc.nextInt();
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
        }
        int flag = 1, t, minj = 0, change = 0;
        boolean dif = false;
        for(int i=0; i<=N-1; i++){
            minj = i;
            for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } 
            t = A[i];
            A[i] = A[minj];
            A[minj] = t;
            if(dif){
                change++;
                dif = false;
            }
        }
        for(int j=0; j<N; j++)  {
            System.out.print(A[j]);
            if(j != N-1) System.out.print(" ");
        }
        System.out.println("\n" + change);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int A[] = new int[100];
        int N = sc.nextInt();
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
        }
        int flag = 1, t, minj = 0, change = 0;
        boolean dif = false;
        for(int i=0; i<=N-1; i++){
            minj = i;
            for(int j=i; j<=N-1; j++){
                if(A[j] < A[minj]){
                    minj = j;
                    dif = true;
                }
            } 
            t = A[i];
            A[i] = A[minj];
            A[minj] = t;
            if(dif){
                change++;
                dif = false;
            }
        }
        for(int j=0; j<N; j++)  {
            System.out.print(A[j]);
            if(j != N-1) System.out.print(" ");
        }
        System.out.println("\n" + change);
    }
}
