import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public void Sort(){

	}

	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int count = 0;
        int w = 0;

        //??\????????¢
        int[] LaunderingNum = new int[Integer.parseInt(n)];

        String[] input2 = br.readLine().split(" ");

        for(int i = 0; i < LaunderingNum.length; i++){
        	LaunderingNum[i] = Integer.parseInt(input2[i]);
        }

        //
        for(int i = 0; i < LaunderingNum.length - 1; i++){
        	
        	int minj = i;
        	
        	for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	}
        	if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	}

        }
        //
        for(int i = 0; i < LaunderingNum.length; i++){

        	if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	}

        }
        System.out.println(count);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {

	public void Sort(){

	}

	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int count = 0;
        int w = 0;

        //??\????????¢
        int[] LaunderingNum = new int[Integer.parseInt(n)];

        String[] input2 = br.readLine().split(" ");

        for(int i = 0; i < LaunderingNum.length; i++){
        	LaunderingNum[i] = Integer.parseInt(input2[i]);
        }

        //
        for(int i = 0; i < LaunderingNum.length - 1; i++){
        	
        	int minj = i;
        	
        	for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	}
        	if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	}

        }
        //
        for(int i = 0; i < LaunderingNum.length; i++){

        	if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	}

        }
        System.out.println(count);
	}
} Main public void Sort(){

	} Sort {

	} public void maain(){

	} maain {

	} public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int count = 0;
        int w = 0;

        //??\????????¢
        int[] LaunderingNum = new int[Integer.parseInt(n)];

        String[] input2 = br.readLine().split(" ");

        for(int i = 0; i < LaunderingNum.length; i++){
        	LaunderingNum[i] = Integer.parseInt(input2[i]);
        }

        //
        for(int i = 0; i < LaunderingNum.length - 1; i++){
        	
        	int minj = i;
        	
        	for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	}
        	if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	}

        }
        //
        for(int i = 0; i < LaunderingNum.length; i++){

        	if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	}

        }
        System.out.println(count);
	} main {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int count = 0;
        int w = 0;

        //??\????????¢
        int[] LaunderingNum = new int[Integer.parseInt(n)];

        String[] input2 = br.readLine().split(" ");

        for(int i = 0; i < LaunderingNum.length; i++){
        	LaunderingNum[i] = Integer.parseInt(input2[i]);
        }

        //
        for(int i = 0; i < LaunderingNum.length - 1; i++){
        	
        	int minj = i;
        	
        	for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	}
        	if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	}

        }
        //
        for(int i = 0; i < LaunderingNum.length; i++){

        	if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	}

        }
        System.out.println(count);
	} StringBuilder buider = new StringBuilder(); buider new StringBuilder() BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String n = br.readLine(); n br.readLine() br.readLine br int count = 0; count 0 int w = 0; w 0 int[] LaunderingNum = new int[Integer.parseInt(n)]; LaunderingNum new int[Integer.parseInt(n)] Integer.parseInt(n) Integer.parseInt Integer n String[] input2 = br.readLine().split(" "); input2 br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for(int i = 0; i < LaunderingNum.length; i++){
        	LaunderingNum[i] = Integer.parseInt(input2[i]);
        } int i = 0; int i = 0; i 0 i < LaunderingNum.length i LaunderingNum.length LaunderingNum LaunderingNum.length i++ i++ i {
        	LaunderingNum[i] = Integer.parseInt(input2[i]);
        } {
        	LaunderingNum[i] = Integer.parseInt(input2[i]);
        } LaunderingNum[i] = Integer.parseInt(input2[i]) LaunderingNum[i] LaunderingNum i Integer.parseInt(input2[i]) Integer.parseInt Integer input2[i] input2 i for(int i = 0; i < LaunderingNum.length - 1; i++){
        	
        	int minj = i;
        	
        	for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	}
        	if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	}

        } int i = 0; int i = 0; i 0 i < LaunderingNum.length - 1 i LaunderingNum.length - 1 LaunderingNum.length LaunderingNum LaunderingNum.length 1 i++ i++ i {
        	
        	int minj = i;
        	
        	for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	}
        	if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	}

        } {
        	
        	int minj = i;
        	
        	for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	}
        	if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	}

        } int minj = i; minj i for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	} int j = i + 1; int j = i + 1; j i + 1 i 1 j < LaunderingNum.length j LaunderingNum.length LaunderingNum LaunderingNum.length j++ j++ j {
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	} {
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	} if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		} LaunderingNum[j] < LaunderingNum[minj] LaunderingNum[j] LaunderingNum j LaunderingNum[minj] LaunderingNum minj {
        			minj = j;
        		} minj = j minj j if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	} minj != i minj i {
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	} w = LaunderingNum[i] w LaunderingNum[i] LaunderingNum i LaunderingNum[i] = LaunderingNum[minj] LaunderingNum[i] LaunderingNum i LaunderingNum[minj] LaunderingNum minj LaunderingNum[minj] = w LaunderingNum[minj] LaunderingNum minj w count++ count for(int i = 0; i < LaunderingNum.length; i++){

        	if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	}

        } int i = 0; int i = 0; i 0 i < LaunderingNum.length i LaunderingNum.length LaunderingNum LaunderingNum.length i++ i++ i {

        	if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	}

        } {

        	if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	}

        } if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	} i == LaunderingNum.length - 1 i LaunderingNum.length - 1 LaunderingNum.length LaunderingNum LaunderingNum.length 1 {
        		System.out.println(LaunderingNum[i]);
        	} System.out.println(LaunderingNum[i]) System.out.println System.out System System.out LaunderingNum[i] LaunderingNum i {
            	System.out.print(LaunderingNum[i] + " ");
        	} System.out.print(LaunderingNum[i] + " ") System.out.print System.out System System.out LaunderingNum[i] + " " LaunderingNum[i] LaunderingNum i " " System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

	public void Sort(){

	}

	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int count = 0;
        int w = 0;

        //??\????????¢
        int[] LaunderingNum = new int[Integer.parseInt(n)];

        String[] input2 = br.readLine().split(" ");

        for(int i = 0; i < LaunderingNum.length; i++){
        	LaunderingNum[i] = Integer.parseInt(input2[i]);
        }

        //
        for(int i = 0; i < LaunderingNum.length - 1; i++){
        	
        	int minj = i;
        	
        	for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	}
        	if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	}

        }
        //
        for(int i = 0; i < LaunderingNum.length; i++){

        	if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	}

        }
        System.out.println(count);
	}
} public class Main {

	public void Sort(){

	}

	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int count = 0;
        int w = 0;

        //??\????????¢
        int[] LaunderingNum = new int[Integer.parseInt(n)];

        String[] input2 = br.readLine().split(" ");

        for(int i = 0; i < LaunderingNum.length; i++){
        	LaunderingNum[i] = Integer.parseInt(input2[i]);
        }

        //
        for(int i = 0; i < LaunderingNum.length - 1; i++){
        	
        	int minj = i;
        	
        	for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	}
        	if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	}

        }
        //
        for(int i = 0; i < LaunderingNum.length; i++){

        	if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	}

        }
        System.out.println(count);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public void Sort(){

	}

	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int count = 0;
        int w = 0;

        //??\????????¢
        int[] LaunderingNum = new int[Integer.parseInt(n)];

        String[] input2 = br.readLine().split(" ");

        for(int i = 0; i < LaunderingNum.length; i++){
        	LaunderingNum[i] = Integer.parseInt(input2[i]);
        }

        //
        for(int i = 0; i < LaunderingNum.length - 1; i++){
        	
        	int minj = i;
        	
        	for(int j = i + 1; j < LaunderingNum.length; j++){
        		
        		if(LaunderingNum[j] < LaunderingNum[minj]){
        			minj = j;
        		}
        	}
        	if(minj != i){
        		
    			w = LaunderingNum[i];
    			LaunderingNum[i] = LaunderingNum[minj];
    			LaunderingNum[minj] = w;
    			count++;
        	}

        }
        //
        for(int i = 0; i < LaunderingNum.length; i++){

        	if(i == LaunderingNum.length - 1){
        		System.out.println(LaunderingNum[i]);
        	}else{
            	System.out.print(LaunderingNum[i] + " ");
        	}

        }
        System.out.println(count);
	}
}