import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args) throws Exception{
	int i=0;
	int j=0;
	int tmp;
	int Count_Sort = 0;
	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String N_str = br.readLine();
	int N = Integer.parseInt(N_str);
	
	int[] A;
	A = new int[N];
	
	String A_str = br.readLine();
	Scanner sc = new Scanner(A_str).useDelimiter("\\s* \\s*");
	
	while(sc.hasNext()){
	    A[i] = sc.nextInt();
	    i++;
	}

	for(i=0;i<N;i++){
	    int minj = i;
	    for(j=i;j<N;j++){
		if(A[j]<A[minj]){
		    minj = j;
		}
	    }
	    tmp = A[i];
	    A[i] = A[minj];
	    A[minj] = tmp;
	    if(i!=minj) Count_Sort++;
	}
	    

	for(i=0;i<N;i++){
	    System.out.print(A[i]);
	    if(i!=N-1) System.out.print(" ");
	}
	System.out.println("");
	System.out.println(Count_Sort);
	sc.close();
    }
}
 import java.io.*; io.* java import java.util.*; util.* java class Main{
    public static void main(String[] args) throws Exception{
	int i=0;
	int j=0;
	int tmp;
	int Count_Sort = 0;
	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String N_str = br.readLine();
	int N = Integer.parseInt(N_str);
	
	int[] A;
	A = new int[N];
	
	String A_str = br.readLine();
	Scanner sc = new Scanner(A_str).useDelimiter("\\s* \\s*");
	
	while(sc.hasNext()){
	    A[i] = sc.nextInt();
	    i++;
	}

	for(i=0;i<N;i++){
	    int minj = i;
	    for(j=i;j<N;j++){
		if(A[j]<A[minj]){
		    minj = j;
		}
	    }
	    tmp = A[i];
	    A[i] = A[minj];
	    A[minj] = tmp;
	    if(i!=minj) Count_Sort++;
	}
	    

	for(i=0;i<N;i++){
	    System.out.print(A[i]);
	    if(i!=N-1) System.out.print(" ");
	}
	System.out.println("");
	System.out.println(Count_Sort);
	sc.close();
    }
} Main public static void main(String[] args) throws Exception{
	int i=0;
	int j=0;
	int tmp;
	int Count_Sort = 0;
	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String N_str = br.readLine();
	int N = Integer.parseInt(N_str);
	
	int[] A;
	A = new int[N];
	
	String A_str = br.readLine();
	Scanner sc = new Scanner(A_str).useDelimiter("\\s* \\s*");
	
	while(sc.hasNext()){
	    A[i] = sc.nextInt();
	    i++;
	}

	for(i=0;i<N;i++){
	    int minj = i;
	    for(j=i;j<N;j++){
		if(A[j]<A[minj]){
		    minj = j;
		}
	    }
	    tmp = A[i];
	    A[i] = A[minj];
	    A[minj] = tmp;
	    if(i!=minj) Count_Sort++;
	}
	    

	for(i=0;i<N;i++){
	    System.out.print(A[i]);
	    if(i!=N-1) System.out.print(" ");
	}
	System.out.println("");
	System.out.println(Count_Sort);
	sc.close();
    } main {
	int i=0;
	int j=0;
	int tmp;
	int Count_Sort = 0;
	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String N_str = br.readLine();
	int N = Integer.parseInt(N_str);
	
	int[] A;
	A = new int[N];
	
	String A_str = br.readLine();
	Scanner sc = new Scanner(A_str).useDelimiter("\\s* \\s*");
	
	while(sc.hasNext()){
	    A[i] = sc.nextInt();
	    i++;
	}

	for(i=0;i<N;i++){
	    int minj = i;
	    for(j=i;j<N;j++){
		if(A[j]<A[minj]){
		    minj = j;
		}
	    }
	    tmp = A[i];
	    A[i] = A[minj];
	    A[minj] = tmp;
	    if(i!=minj) Count_Sort++;
	}
	    

	for(i=0;i<N;i++){
	    System.out.print(A[i]);
	    if(i!=N-1) System.out.print(" ");
	}
	System.out.println("");
	System.out.println(Count_Sort);
	sc.close();
    } int i=0; i 0 int j=0; j 0 int tmp; tmp int Count_Sort = 0; Count_Sort 0 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String N_str = br.readLine(); N_str br.readLine() br.readLine br int N = Integer.parseInt(N_str); N Integer.parseInt(N_str) Integer.parseInt Integer N_str int[] A; A A = new int[N] A new int[N] N String A_str = br.readLine(); A_str br.readLine() br.readLine br Scanner sc = new Scanner(A_str).useDelimiter("\\s* \\s*"); sc new Scanner(A_str).useDelimiter("\\s* \\s*") new Scanner(A_str).useDelimiter new Scanner(A_str) "\\s* \\s*" while(sc.hasNext()){
	    A[i] = sc.nextInt();
	    i++;
	} sc.hasNext() sc.hasNext sc {
	    A[i] = sc.nextInt();
	    i++;
	} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc i++ i for(i=0;i<N;i++){
	    int minj = i;
	    for(j=i;j<N;j++){
		if(A[j]<A[minj]){
		    minj = j;
		}
	    }
	    tmp = A[i];
	    A[i] = A[minj];
	    A[minj] = tmp;
	    if(i!=minj) Count_Sort++;
	} i=0; i=0 i 0 i<N i N i++ i++ i {
	    int minj = i;
	    for(j=i;j<N;j++){
		if(A[j]<A[minj]){
		    minj = j;
		}
	    }
	    tmp = A[i];
	    A[i] = A[minj];
	    A[minj] = tmp;
	    if(i!=minj) Count_Sort++;
	} {
	    int minj = i;
	    for(j=i;j<N;j++){
		if(A[j]<A[minj]){
		    minj = j;
		}
	    }
	    tmp = A[i];
	    A[i] = A[minj];
	    A[minj] = tmp;
	    if(i!=minj) Count_Sort++;
	} int minj = i; minj i for(j=i;j<N;j++){
		if(A[j]<A[minj]){
		    minj = j;
		}
	    } j=i; j=i j i j<N j N 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 minj j 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 if(i!=minj) Count_Sort++; i!=minj i minj Count_Sort++ Count_Sort for(i=0;i<N;i++){
	    System.out.print(A[i]);
	    if(i!=N-1) System.out.print(" ");
	} i=0; 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 System System.out " " System.out.println("") System.out.println System.out System System.out "" System.out.println(Count_Sort) System.out.println System.out System System.out Count_Sort sc.close() sc.close sc String[] args args
import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args) throws Exception{
	int i=0;
	int j=0;
	int tmp;
	int Count_Sort = 0;
	
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	String N_str = br.readLine();
	int N = Integer.parseInt(N_str);
	
	int[] A;
	A = new int[N];
	
	String A_str = br.readLine();
	Scanner sc = new Scanner(A_str).useDelimiter("\\s* \\s*");
	
	while(sc.hasNext()){
	    A[i] = sc.nextInt();
	    i++;
	}

	for(i=0;i<N;i++){
	    int minj = i;
	    for(j=i;j<N;j++){
		if(A[j]<A[minj]){
		    minj = j;
		}
	    }
	    tmp = A[i];
	    A[i] = A[minj];
	    A[minj] = tmp;
	    if(i!=minj) Count_Sort++;
	}
	    

	for(i=0;i<N;i++){
	    System.out.print(A[i]);
	    if(i!=N-1) System.out.print(" ");
	}
	System.out.println("");
	System.out.println(Count_Sort);
	sc.close();
    }
}

