import java.util.Scanner;

public class Main {
	static Scanner scan = new Scanner (System.in);
	public static void main(String args[]){
		run();
	}
	static void run(){
		int n, minJ, tmp, count;
		boolean judge;
		
		n = scan.nextInt();
		
		int[] a = new int[n];
		
		count = 0;
		
		judge = false;
		
		for(int i = 0; i < n; i++){
			a[i] = scan.nextInt();
		}
		
		for(int i = 0; i < n; i++){
			minJ = i;
			for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			}
			
			if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			}
		}
		for(int i = 0; i < n; i++){
			if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			}
		}
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	static Scanner scan = new Scanner (System.in);
	public static void main(String args[]){
		run();
	}
	static void run(){
		int n, minJ, tmp, count;
		boolean judge;
		
		n = scan.nextInt();
		
		int[] a = new int[n];
		
		count = 0;
		
		judge = false;
		
		for(int i = 0; i < n; i++){
			a[i] = scan.nextInt();
		}
		
		for(int i = 0; i < n; i++){
			minJ = i;
			for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			}
			
			if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			}
		}
		for(int i = 0; i < n; i++){
			if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			}
		}
		System.out.println(count);
	}
} Main static Scanner scan = new Scanner (System.in); scan new Scanner (System.in) public static void main(String args[]){
		run();
	} main {
		run();
	} run() run String args[] args static void run(){
		int n, minJ, tmp, count;
		boolean judge;
		
		n = scan.nextInt();
		
		int[] a = new int[n];
		
		count = 0;
		
		judge = false;
		
		for(int i = 0; i < n; i++){
			a[i] = scan.nextInt();
		}
		
		for(int i = 0; i < n; i++){
			minJ = i;
			for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			}
			
			if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			}
		}
		for(int i = 0; i < n; i++){
			if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			}
		}
		System.out.println(count);
	} run {
		int n, minJ, tmp, count;
		boolean judge;
		
		n = scan.nextInt();
		
		int[] a = new int[n];
		
		count = 0;
		
		judge = false;
		
		for(int i = 0; i < n; i++){
			a[i] = scan.nextInt();
		}
		
		for(int i = 0; i < n; i++){
			minJ = i;
			for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			}
			
			if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			}
		}
		for(int i = 0; i < n; i++){
			if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			}
		}
		System.out.println(count);
	} int n n minJ minJ tmp tmp count; count boolean judge; judge n = scan.nextInt() n scan.nextInt() scan.nextInt scan int[] a = new int[n]; a new int[n] n count = 0 count 0 judge = false judge false for(int i = 0; i < n; i++){
			a[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = scan.nextInt();
		} {
			a[i] = scan.nextInt();
		} a[i] = scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan for(int i = 0; i < n; i++){
			minJ = i;
			for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			}
			
			if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			minJ = i;
			for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			}
			
			if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			}
		} {
			minJ = i;
			for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			}
			
			if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			}
		} minJ = i minJ i for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			} int j = i; int j = i; j i j < n j n j++ j++ j {
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			} {
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			} if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				} a[j] < a[minJ] a[j] a j a[minJ] a minJ {
					minJ = j;
					judge = true;
				} minJ = j minJ j judge = true judge true if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			} judge {
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			} 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 count++ count judge = false judge false for(int i = 0; i < n; i++){
			if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			}
		} {
			if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			}
		} if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			} i == n - 1 i n - 1 n 1 {
				System.out.println(a[i]);
			} System.out.println(a[i]) System.out.println System.out System System.out a[i] a i {
				System.out.print(a[i]+" ");
			} System.out.print(a[i]+" ") System.out.print System.out System System.out a[i]+" " a[i] a i " " System.out.println(count) System.out.println System.out System System.out count public class Main {
	static Scanner scan = new Scanner (System.in);
	public static void main(String args[]){
		run();
	}
	static void run(){
		int n, minJ, tmp, count;
		boolean judge;
		
		n = scan.nextInt();
		
		int[] a = new int[n];
		
		count = 0;
		
		judge = false;
		
		for(int i = 0; i < n; i++){
			a[i] = scan.nextInt();
		}
		
		for(int i = 0; i < n; i++){
			minJ = i;
			for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			}
			
			if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			}
		}
		for(int i = 0; i < n; i++){
			if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			}
		}
		System.out.println(count);
	}
} public class Main {
	static Scanner scan = new Scanner (System.in);
	public static void main(String args[]){
		run();
	}
	static void run(){
		int n, minJ, tmp, count;
		boolean judge;
		
		n = scan.nextInt();
		
		int[] a = new int[n];
		
		count = 0;
		
		judge = false;
		
		for(int i = 0; i < n; i++){
			a[i] = scan.nextInt();
		}
		
		for(int i = 0; i < n; i++){
			minJ = i;
			for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			}
			
			if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			}
		}
		for(int i = 0; i < n; i++){
			if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			}
		}
		System.out.println(count);
	}
} Main
import java.util.Scanner;

public class Main {
	static Scanner scan = new Scanner (System.in);
	public static void main(String args[]){
		run();
	}
	static void run(){
		int n, minJ, tmp, count;
		boolean judge;
		
		n = scan.nextInt();
		
		int[] a = new int[n];
		
		count = 0;
		
		judge = false;
		
		for(int i = 0; i < n; i++){
			a[i] = scan.nextInt();
		}
		
		for(int i = 0; i < n; i++){
			minJ = i;
			for(int j = i; j < n; j++){
				if(a[j] < a[minJ]){
					minJ = j;
					judge = true;
				}
			}
			
			if(judge){
				tmp = a[i];
				a[i] = a[minJ];
				a[minJ] = tmp;
				count++;
				judge = false;
			}
		}
		for(int i = 0; i < n; i++){
			if(i == n - 1){
				System.out.println(a[i]);
			}else{
				System.out.print(a[i]+" ");
			}
		}
		System.out.println(count);
	}
}