import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] array = new int[num];
        for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        }
        int temp = 0, count = 0, minj = 0;
        for(int i = 0; i < num - 1; i++){
            minj = i;
            for(int j = i; j < num; j++){
                if(array[j] < array[minj]){
                    minj = j;
                }
            }
            temp = array[i];
            array[i] = array[minj];
            array[minj] = temp;
            if(i != minj){
                count++;
            }
        }
        System.out.print(array[0]);
        for(int i = 1; i < num; i++){
            System.out.print(" " + array[i]);
        }
        System.out.println("\n" + count);
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] array = new int[num];
        for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        }
        int temp = 0, count = 0, minj = 0;
        for(int i = 0; i < num - 1; i++){
            minj = i;
            for(int j = i; j < num; j++){
                if(array[j] < array[minj]){
                    minj = j;
                }
            }
            temp = array[i];
            array[i] = array[minj];
            array[minj] = temp;
            if(i != minj){
                count++;
            }
        }
        System.out.print(array[0]);
        for(int i = 1; i < num; i++){
            System.out.print(" " + array[i]);
        }
        System.out.println("\n" + count);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] array = new int[num];
        for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        }
        int temp = 0, count = 0, minj = 0;
        for(int i = 0; i < num - 1; i++){
            minj = i;
            for(int j = i; j < num; j++){
                if(array[j] < array[minj]){
                    minj = j;
                }
            }
            temp = array[i];
            array[i] = array[minj];
            array[minj] = temp;
            if(i != minj){
                count++;
            }
        }
        System.out.print(array[0]);
        for(int i = 1; i < num; i++){
            System.out.print(" " + array[i]);
        }
        System.out.println("\n" + count);
    } main {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] array = new int[num];
        for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        }
        int temp = 0, count = 0, minj = 0;
        for(int i = 0; i < num - 1; i++){
            minj = i;
            for(int j = i; j < num; j++){
                if(array[j] < array[minj]){
                    minj = j;
                }
            }
            temp = array[i];
            array[i] = array[minj];
            array[minj] = temp;
            if(i != minj){
                count++;
            }
        }
        System.out.print(array[0]);
        for(int i = 1; i < num; i++){
            System.out.print(" " + array[i]);
        }
        System.out.println("\n" + count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int[] array = new int[num]; array new int[num] num for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            array[i] = sc.nextInt();
        } {
            array[i] = sc.nextInt();
        } array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc int temp = 0 temp 0 count = 0 count 0 minj = 0; minj 0 for(int i = 0; i < num - 1; i++){
            minj = i;
            for(int j = i; j < num; j++){
                if(array[j] < array[minj]){
                    minj = j;
                }
            }
            temp = array[i];
            array[i] = array[minj];
            array[minj] = temp;
            if(i != minj){
                count++;
            }
        } int i = 0; int i = 0; i 0 i < num - 1 i num - 1 num 1 i++ i++ i {
            minj = i;
            for(int j = i; j < num; j++){
                if(array[j] < array[minj]){
                    minj = j;
                }
            }
            temp = array[i];
            array[i] = array[minj];
            array[minj] = temp;
            if(i != minj){
                count++;
            }
        } {
            minj = i;
            for(int j = i; j < num; j++){
                if(array[j] < array[minj]){
                    minj = j;
                }
            }
            temp = array[i];
            array[i] = array[minj];
            array[minj] = temp;
            if(i != minj){
                count++;
            }
        } minj = i minj i for(int j = i; j < num; j++){
                if(array[j] < array[minj]){
                    minj = j;
                }
            } int j = i; int j = i; j i j < num j num j++ j++ j {
                if(array[j] < array[minj]){
                    minj = j;
                }
            } {
                if(array[j] < array[minj]){
                    minj = j;
                }
            } if(array[j] < array[minj]){
                    minj = j;
                } array[j] < array[minj] array[j] array j array[minj] array minj {
                    minj = j;
                } minj = j minj j temp = array[i] temp array[i] array i array[i] = array[minj] array[i] array i array[minj] array minj array[minj] = temp array[minj] array minj temp if(i != minj){
                count++;
            } i != minj i minj {
                count++;
            } count++ count System.out.print(array[0]) System.out.print System.out System System.out array[0] array 0 for(int i = 1; i < num; i++){
            System.out.print(" " + array[i]);
        } int i = 1; int i = 1; i 1 i < num i num i++ i++ i {
            System.out.print(" " + array[i]);
        } {
            System.out.print(" " + array[i]);
        } System.out.print(" " + array[i]) System.out.print System.out System System.out " " + array[i] " " array[i] array i System.out.println("\n" + count) System.out.println System.out System System.out "\n" + count "\n" count String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] array = new int[num];
        for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        }
        int temp = 0, count = 0, minj = 0;
        for(int i = 0; i < num - 1; i++){
            minj = i;
            for(int j = i; j < num; j++){
                if(array[j] < array[minj]){
                    minj = j;
                }
            }
            temp = array[i];
            array[i] = array[minj];
            array[minj] = temp;
            if(i != minj){
                count++;
            }
        }
        System.out.print(array[0]);
        for(int i = 1; i < num; i++){
            System.out.print(" " + array[i]);
        }
        System.out.println("\n" + count);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] array = new int[num];
        for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        }
        int temp = 0, count = 0, minj = 0;
        for(int i = 0; i < num - 1; i++){
            minj = i;
            for(int j = i; j < num; j++){
                if(array[j] < array[minj]){
                    minj = j;
                }
            }
            temp = array[i];
            array[i] = array[minj];
            array[minj] = temp;
            if(i != minj){
                count++;
            }
        }
        System.out.print(array[0]);
        for(int i = 1; i < num; i++){
            System.out.print(" " + array[i]);
        }
        System.out.println("\n" + count);
    }
} Main
import java.util.Scanner;

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