import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
  
public class Main {
    private static final String CRLF = System.lineSeparator();
    public void exec() throws IOException {
    	SimpleInputUtil in = new SimpleInputUtil();
        PrintWriter out = new PrintWriter(System.out);
        StringBuilder sb = new StringBuilder();
        int[] A = in.readIntArray(in.readInt());
        int swapcount = selectionSort(A);
        intArrayToString(A,sb);
        out.print(sb.toString());
        out.println(swapcount);
        out.flush();
    }
    
    private int selectionSort(int[] A){
    	int ret=0;
    	int minj,tmp;
    	for(int i=0; i<A.length; i++) {
    		minj = i;
    		for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		}
			if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			}
    	}
    	return ret;
    }
    
    private void intArrayToString(int[] a, StringBuilder sb) {
        for(int i=0; i<a.length; i++) {
            if (i>0)
                sb.append(" ");
            sb.append(a[i]);
        }
        sb.append(CRLF);
    }
     
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
}

class SimpleInputUtil {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    public int readInt() throws NumberFormatException, IOException{
    	return Integer.parseInt(br.readLine());
    }
    public int[] readIntArray(int len) throws NumberFormatException, IOException{
        int[] a = new int[len];
        int i=0;
        for(String s: br.readLine().split(" ")){
            a[i++] = Integer.parseInt(s);
        }
        return a;
    }
    
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {
    private static final String CRLF = System.lineSeparator();
    public void exec() throws IOException {
    	SimpleInputUtil in = new SimpleInputUtil();
        PrintWriter out = new PrintWriter(System.out);
        StringBuilder sb = new StringBuilder();
        int[] A = in.readIntArray(in.readInt());
        int swapcount = selectionSort(A);
        intArrayToString(A,sb);
        out.print(sb.toString());
        out.println(swapcount);
        out.flush();
    }
    
    private int selectionSort(int[] A){
    	int ret=0;
    	int minj,tmp;
    	for(int i=0; i<A.length; i++) {
    		minj = i;
    		for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		}
			if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			}
    	}
    	return ret;
    }
    
    private void intArrayToString(int[] a, StringBuilder sb) {
        for(int i=0; i<a.length; i++) {
            if (i>0)
                sb.append(" ");
            sb.append(a[i]);
        }
        sb.append(CRLF);
    }
     
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} Main private static final String CRLF = System.lineSeparator(); CRLF System.lineSeparator() System.lineSeparator System public void exec() throws IOException {
    	SimpleInputUtil in = new SimpleInputUtil();
        PrintWriter out = new PrintWriter(System.out);
        StringBuilder sb = new StringBuilder();
        int[] A = in.readIntArray(in.readInt());
        int swapcount = selectionSort(A);
        intArrayToString(A,sb);
        out.print(sb.toString());
        out.println(swapcount);
        out.flush();
    } exec {
    	SimpleInputUtil in = new SimpleInputUtil();
        PrintWriter out = new PrintWriter(System.out);
        StringBuilder sb = new StringBuilder();
        int[] A = in.readIntArray(in.readInt());
        int swapcount = selectionSort(A);
        intArrayToString(A,sb);
        out.print(sb.toString());
        out.println(swapcount);
        out.flush();
    } SimpleInputUtil in = new SimpleInputUtil(); in new SimpleInputUtil() PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int[] A = in.readIntArray(in.readInt()); A in.readIntArray(in.readInt()) in.readIntArray in in.readInt() in.readInt in int swapcount = selectionSort(A); swapcount selectionSort(A) selectionSort A intArrayToString(A,sb) intArrayToString A sb out.print(sb.toString()) out.print out sb.toString() sb.toString sb out.println(swapcount) out.println out swapcount out.flush() out.flush out private int selectionSort(int[] A){
    	int ret=0;
    	int minj,tmp;
    	for(int i=0; i<A.length; i++) {
    		minj = i;
    		for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		}
			if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			}
    	}
    	return ret;
    } selectionSort {
    	int ret=0;
    	int minj,tmp;
    	for(int i=0; i<A.length; i++) {
    		minj = i;
    		for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		}
			if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			}
    	}
    	return ret;
    } int ret=0; ret 0 int minj minj tmp; tmp for(int i=0; i<A.length; i++) {
    		minj = i;
    		for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		}
			if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			}
    	} int i=0; int i=0; i 0 i<A.length i A.length A A.length i++ i++ i {
    		minj = i;
    		for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		}
			if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			}
    	} {
    		minj = i;
    		for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		}
			if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			}
    	} minj = i minj i for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		} int j=i; int j=i; j i j<A.length j A.length A A.length 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 if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			} i!=minj i minj {
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			} tmp = A[i] tmp A[i] A i A[i] = A[minj] A[i] A i A[minj] A minj A[minj] = tmp A[minj] A minj tmp ret++ ret return ret; ret int[] A A private void intArrayToString(int[] a, StringBuilder sb) {
        for(int i=0; i<a.length; i++) {
            if (i>0)
                sb.append(" ");
            sb.append(a[i]);
        }
        sb.append(CRLF);
    } intArrayToString {
        for(int i=0; i<a.length; i++) {
            if (i>0)
                sb.append(" ");
            sb.append(a[i]);
        }
        sb.append(CRLF);
    } for(int i=0; i<a.length; i++) {
            if (i>0)
                sb.append(" ");
            sb.append(a[i]);
        } int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
            if (i>0)
                sb.append(" ");
            sb.append(a[i]);
        } {
            if (i>0)
                sb.append(" ");
            sb.append(a[i]);
        } if (i>0)
                sb.append(" "); i>0 i 0 sb.append(" ") sb.append sb " " sb.append(a[i]) sb.append sb a[i] a i sb.append(CRLF) sb.append sb CRLF int[] a a StringBuilder sb sb public static void main(String[] args) throws IOException {
        new Main().exec();
    } main {
        new Main().exec();
    } new Main().exec() new Main().exec new Main() String[] args args class SimpleInputUtil {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    public int readInt() throws NumberFormatException, IOException{
    	return Integer.parseInt(br.readLine());
    }
    public int[] readIntArray(int len) throws NumberFormatException, IOException{
        int[] a = new int[len];
        int i=0;
        for(String s: br.readLine().split(" ")){
            a[i++] = Integer.parseInt(s);
        }
        return a;
    }
    
} SimpleInputUtil BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) public int readInt() throws NumberFormatException, IOException{
    	return Integer.parseInt(br.readLine());
    } readInt {
    	return Integer.parseInt(br.readLine());
    } return Integer.parseInt(br.readLine()); Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br public int[] readIntArray(int len) throws NumberFormatException, IOException{
        int[] a = new int[len];
        int i=0;
        for(String s: br.readLine().split(" ")){
            a[i++] = Integer.parseInt(s);
        }
        return a;
    } readIntArray {
        int[] a = new int[len];
        int i=0;
        for(String s: br.readLine().split(" ")){
            a[i++] = Integer.parseInt(s);
        }
        return a;
    } int[] a = new int[len]; a new int[len] len int i=0; i 0 for(String s: br.readLine().split(" ")){
            a[i++] = Integer.parseInt(s);
        } String s br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " {
            a[i++] = Integer.parseInt(s);
        } {
            a[i++] = Integer.parseInt(s);
        } a[i++] = Integer.parseInt(s) a[i++] a i++ i Integer.parseInt(s) Integer.parseInt Integer s return a; a int len len public class Main {
    private static final String CRLF = System.lineSeparator();
    public void exec() throws IOException {
    	SimpleInputUtil in = new SimpleInputUtil();
        PrintWriter out = new PrintWriter(System.out);
        StringBuilder sb = new StringBuilder();
        int[] A = in.readIntArray(in.readInt());
        int swapcount = selectionSort(A);
        intArrayToString(A,sb);
        out.print(sb.toString());
        out.println(swapcount);
        out.flush();
    }
    
    private int selectionSort(int[] A){
    	int ret=0;
    	int minj,tmp;
    	for(int i=0; i<A.length; i++) {
    		minj = i;
    		for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		}
			if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			}
    	}
    	return ret;
    }
    
    private void intArrayToString(int[] a, StringBuilder sb) {
        for(int i=0; i<a.length; i++) {
            if (i>0)
                sb.append(" ");
            sb.append(a[i]);
        }
        sb.append(CRLF);
    }
     
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} public class Main {
    private static final String CRLF = System.lineSeparator();
    public void exec() throws IOException {
    	SimpleInputUtil in = new SimpleInputUtil();
        PrintWriter out = new PrintWriter(System.out);
        StringBuilder sb = new StringBuilder();
        int[] A = in.readIntArray(in.readInt());
        int swapcount = selectionSort(A);
        intArrayToString(A,sb);
        out.print(sb.toString());
        out.println(swapcount);
        out.flush();
    }
    
    private int selectionSort(int[] A){
    	int ret=0;
    	int minj,tmp;
    	for(int i=0; i<A.length; i++) {
    		minj = i;
    		for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		}
			if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			}
    	}
    	return ret;
    }
    
    private void intArrayToString(int[] a, StringBuilder sb) {
        for(int i=0; i<a.length; i++) {
            if (i>0)
                sb.append(" ");
            sb.append(a[i]);
        }
        sb.append(CRLF);
    }
     
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
  
public class Main {
    private static final String CRLF = System.lineSeparator();
    public void exec() throws IOException {
    	SimpleInputUtil in = new SimpleInputUtil();
        PrintWriter out = new PrintWriter(System.out);
        StringBuilder sb = new StringBuilder();
        int[] A = in.readIntArray(in.readInt());
        int swapcount = selectionSort(A);
        intArrayToString(A,sb);
        out.print(sb.toString());
        out.println(swapcount);
        out.flush();
    }
    
    private int selectionSort(int[] A){
    	int ret=0;
    	int minj,tmp;
    	for(int i=0; i<A.length; i++) {
    		minj = i;
    		for(int j=i; j<A.length; j++){
    			if(A[j] < A[minj])
    				minj=j;
    		}
			if(i!=minj){
				tmp = A[i];
				A[i] = A[minj];
				A[minj] = tmp;
				ret++;
			}
    	}
    	return ret;
    }
    
    private void intArrayToString(int[] a, StringBuilder sb) {
        for(int i=0; i<a.length; i++) {
            if (i>0)
                sb.append(" ");
            sb.append(a[i]);
        }
        sb.append(CRLF);
    }
     
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
}

class SimpleInputUtil {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    public int readInt() throws NumberFormatException, IOException{
    	return Integer.parseInt(br.readLine());
    }
    public int[] readIntArray(int len) throws NumberFormatException, IOException{
        int[] a = new int[len];
        int i=0;
        for(String s: br.readLine().split(" ")){
            a[i++] = Integer.parseInt(s);
        }
        return a;
    }
    
}