import java.util.*;
import java.lang.*;

public class Main {

    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int[] A = new int[100];
        int sum = 0;

        int N = num.nextInt();
        for(int i = 0; i < N; i++) {
            A[i] = num.nextInt();    
        }

        for(int i = 0; i < N - 1; i++) {
            int min = i;
            for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            }
            if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            }
        }

        for(int i = 0; i < N; i++) {
            System.out.print(A[i]);
            if(i != N - 1) {
                System.out.print(" ");
            }
        }
        System.out.println("\n" + sum);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {

    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int[] A = new int[100];
        int sum = 0;

        int N = num.nextInt();
        for(int i = 0; i < N; i++) {
            A[i] = num.nextInt();    
        }

        for(int i = 0; i < N - 1; i++) {
            int min = i;
            for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            }
            if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            }
        }

        for(int i = 0; i < N; i++) {
            System.out.print(A[i]);
            if(i != N - 1) {
                System.out.print(" ");
            }
        }
        System.out.println("\n" + sum);
    }
} Main public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int[] A = new int[100];
        int sum = 0;

        int N = num.nextInt();
        for(int i = 0; i < N; i++) {
            A[i] = num.nextInt();    
        }

        for(int i = 0; i < N - 1; i++) {
            int min = i;
            for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            }
            if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            }
        }

        for(int i = 0; i < N; i++) {
            System.out.print(A[i]);
            if(i != N - 1) {
                System.out.print(" ");
            }
        }
        System.out.println("\n" + sum);
    } main {
        Scanner num = new Scanner(System.in);
        int[] A = new int[100];
        int sum = 0;

        int N = num.nextInt();
        for(int i = 0; i < N; i++) {
            A[i] = num.nextInt();    
        }

        for(int i = 0; i < N - 1; i++) {
            int min = i;
            for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            }
            if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            }
        }

        for(int i = 0; i < N; i++) {
            System.out.print(A[i]);
            if(i != N - 1) {
                System.out.print(" ");
            }
        }
        System.out.println("\n" + sum);
    } Scanner num = new Scanner(System.in); num new Scanner(System.in) int[] A = new int[100]; A new int[100] 100 int sum = 0; sum 0 int N = num.nextInt(); N num.nextInt() num.nextInt num for(int i = 0; i < N; i++) {
            A[i] = num.nextInt();    
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            A[i] = num.nextInt();    
        } {
            A[i] = num.nextInt();    
        } A[i] = num.nextInt() A[i] A i num.nextInt() num.nextInt num for(int i = 0; i < N - 1; i++) {
            int min = i;
            for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            }
            if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            }
        } int i = 0; int i = 0; i 0 i < N - 1 i N - 1 N 1 i++ i++ i {
            int min = i;
            for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            }
            if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            }
        } {
            int min = i;
            for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            }
            if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            }
        } int min = i; min i for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            } int j = i + 1; int j = i + 1; j i + 1 i 1 j < N j N j++ j++ j {
                if(A[j] < A[min]) {
                    min = j;
                }
            } {
                if(A[j] < A[min]) {
                    min = j;
                }
            } if(A[j] < A[min]) {
                    min = j;
                } A[j] < A[min] A[j] A j A[min] A min {
                    min = j;
                } min = j min j if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            } min != i min i {
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            } int tmp = A[min]; tmp A[min] A min A[min] = A[i] A[min] A min A[i] A i A[i] = tmp A[i] A i tmp sum++ sum 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("\n" + sum) System.out.println System.out System System.out "\n" + sum "\n" sum String[] args args public class Main {

    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int[] A = new int[100];
        int sum = 0;

        int N = num.nextInt();
        for(int i = 0; i < N; i++) {
            A[i] = num.nextInt();    
        }

        for(int i = 0; i < N - 1; i++) {
            int min = i;
            for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            }
            if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            }
        }

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

    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int[] A = new int[100];
        int sum = 0;

        int N = num.nextInt();
        for(int i = 0; i < N; i++) {
            A[i] = num.nextInt();    
        }

        for(int i = 0; i < N - 1; i++) {
            int min = i;
            for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            }
            if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            }
        }

        for(int i = 0; i < N; i++) {
            System.out.print(A[i]);
            if(i != N - 1) {
                System.out.print(" ");
            }
        }
        System.out.println("\n" + sum);
    }
} Main
import java.util.*;
import java.lang.*;

public class Main {

    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int[] A = new int[100];
        int sum = 0;

        int N = num.nextInt();
        for(int i = 0; i < N; i++) {
            A[i] = num.nextInt();    
        }

        for(int i = 0; i < N - 1; i++) {
            int min = i;
            for(int j = i + 1; j < N; j++) {
                if(A[j] < A[min]) {
                    min = j;
                }
            }
            if(min != i){
                int tmp = A[min];
                A[min] = A[i];
                A[i] = tmp;
                sum++;
            }
        }

        for(int i = 0; i < N; i++) {
            System.out.print(A[i]);
            if(i != N - 1) {
                System.out.print(" ");
            }
        }
        System.out.println("\n" + sum);
    }
}
