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

public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] a = new int[n];
		String[] elements = br.readLine().split(" ");
		
		for (int i = 0; i < n; i++){
			a[i] = Integer.parseInt(elements[i]);
		}
		
		int swapCount = 0; 
		
		for(int i = 0; i < a.length; i++){
			int mini = i;
			
			for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = j;
				}
			}
			
			if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			}
		}
		
		String ans = String.valueOf(a[0]);
		for (int i = 1; i < a.length; i++){
			ans += " " + a[i];
		}
		
		System.out.println(ans);
		System.out.println(swapCount);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] a = new int[n];
		String[] elements = br.readLine().split(" ");
		
		for (int i = 0; i < n; i++){
			a[i] = Integer.parseInt(elements[i]);
		}
		
		int swapCount = 0; 
		
		for(int i = 0; i < a.length; i++){
			int mini = i;
			
			for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = j;
				}
			}
			
			if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			}
		}
		
		String ans = String.valueOf(a[0]);
		for (int i = 1; i < a.length; i++){
			ans += " " + a[i];
		}
		
		System.out.println(ans);
		System.out.println(swapCount);
	}
} Main public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] a = new int[n];
		String[] elements = br.readLine().split(" ");
		
		for (int i = 0; i < n; i++){
			a[i] = Integer.parseInt(elements[i]);
		}
		
		int swapCount = 0; 
		
		for(int i = 0; i < a.length; i++){
			int mini = i;
			
			for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = j;
				}
			}
			
			if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			}
		}
		
		String ans = String.valueOf(a[0]);
		for (int i = 1; i < a.length; i++){
			ans += " " + a[i];
		}
		
		System.out.println(ans);
		System.out.println(swapCount);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] a = new int[n];
		String[] elements = br.readLine().split(" ");
		
		for (int i = 0; i < n; i++){
			a[i] = Integer.parseInt(elements[i]);
		}
		
		int swapCount = 0; 
		
		for(int i = 0; i < a.length; i++){
			int mini = i;
			
			for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = j;
				}
			}
			
			if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			}
		}
		
		String ans = String.valueOf(a[0]);
		for (int i = 1; i < a.length; i++){
			ans += " " + a[i];
		}
		
		System.out.println(ans);
		System.out.println(swapCount);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] a = new int[n]; a new int[n] n String[] elements = br.readLine().split(" "); elements br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int i = 0; i < n; i++){
			a[i] = Integer.parseInt(elements[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = Integer.parseInt(elements[i]);
		} {
			a[i] = Integer.parseInt(elements[i]);
		} a[i] = Integer.parseInt(elements[i]) a[i] a i Integer.parseInt(elements[i]) Integer.parseInt Integer elements[i] elements i int swapCount = 0; swapCount 0 for(int i = 0; i < a.length; i++){
			int mini = i;
			
			for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = j;
				}
			}
			
			if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			}
		} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
			int mini = i;
			
			for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = j;
				}
			}
			
			if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			}
		} {
			int mini = i;
			
			for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = j;
				}
			}
			
			if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			}
		} int mini = i; mini i for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = 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[mini]){
					mini = j;
				}
			} {
				if(a[j] < a[mini]){
					mini = j;
				}
			} if(a[j] < a[mini]){
					mini = j;
				} a[j] < a[mini] a[j] a j a[mini] a mini {
					mini = j;
				} mini = j mini j if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			} mini != i mini i {
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			} int v = a[mini]; v a[mini] a mini a[mini] = a[i] a[mini] a mini a[i] a i a[i] = v a[i] a i v swapCount++ swapCount String ans = String.valueOf(a[0]); ans String.valueOf(a[0]) String.valueOf String a[0] a 0 for (int i = 1; i < a.length; i++){
			ans += " " + a[i];
		} int i = 1; int i = 1; i 1 i < a.length i a.length a a.length i++ i++ i {
			ans += " " + a[i];
		} {
			ans += " " + a[i];
		} ans += " " + a[i] ans " " + a[i] " " a[i] a i System.out.println(ans) System.out.println System.out System System.out ans System.out.println(swapCount) System.out.println System.out System System.out swapCount String[] args args public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] a = new int[n];
		String[] elements = br.readLine().split(" ");
		
		for (int i = 0; i < n; i++){
			a[i] = Integer.parseInt(elements[i]);
		}
		
		int swapCount = 0; 
		
		for(int i = 0; i < a.length; i++){
			int mini = i;
			
			for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = j;
				}
			}
			
			if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			}
		}
		
		String ans = String.valueOf(a[0]);
		for (int i = 1; i < a.length; i++){
			ans += " " + a[i];
		}
		
		System.out.println(ans);
		System.out.println(swapCount);
	}
} public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] a = new int[n];
		String[] elements = br.readLine().split(" ");
		
		for (int i = 0; i < n; i++){
			a[i] = Integer.parseInt(elements[i]);
		}
		
		int swapCount = 0; 
		
		for(int i = 0; i < a.length; i++){
			int mini = i;
			
			for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = j;
				}
			}
			
			if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			}
		}
		
		String ans = String.valueOf(a[0]);
		for (int i = 1; i < a.length; i++){
			ans += " " + a[i];
		}
		
		System.out.println(ans);
		System.out.println(swapCount);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] a = new int[n];
		String[] elements = br.readLine().split(" ");
		
		for (int i = 0; i < n; i++){
			a[i] = Integer.parseInt(elements[i]);
		}
		
		int swapCount = 0; 
		
		for(int i = 0; i < a.length; i++){
			int mini = i;
			
			for(int j = i; j < a.length; j++){
				if(a[j] < a[mini]){
					mini = j;
				}
			}
			
			if (mini != i){
				int v = a[mini];
				a[mini] = a[i];
				a[i] = v;
				
				swapCount++;
			}
		}
		
		String ans = String.valueOf(a[0]);
		for (int i = 1; i < a.length; i++){
			ans += " " + a[i];
		}
		
		System.out.println(ans);
		System.out.println(swapCount);
	}
}