import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		int swapCount = 0;
		for(int index = 0; index < n; index++) {
			int minj = index;
			for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			}
			if(index != minj) {
				swapCount++;
			}
			int work = nums[index];
			nums[index] = nums[minj];
			nums[minj] = work;
		}
		printArray(nums);
		System.out.println(swapCount);
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		int swapCount = 0;
		for(int index = 0; index < n; index++) {
			int minj = index;
			for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			}
			if(index != minj) {
				swapCount++;
			}
			int work = nums[index];
			nums[index] = nums[minj];
			nums[minj] = work;
		}
		printArray(nums);
		System.out.println(swapCount);
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		int swapCount = 0;
		for(int index = 0; index < n; index++) {
			int minj = index;
			for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			}
			if(index != minj) {
				swapCount++;
			}
			int work = nums[index];
			nums[index] = nums[minj];
			nums[minj] = work;
		}
		printArray(nums);
		System.out.println(swapCount);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		int swapCount = 0;
		for(int index = 0; index < n; index++) {
			int minj = index;
			for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			}
			if(index != minj) {
				swapCount++;
			}
			int work = nums[index];
			nums[index] = nums[minj];
			nums[minj] = work;
		}
		printArray(nums);
		System.out.println(swapCount);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] nums = new int[n]; nums new int[n] n for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		} int arrayIndex = 0; int arrayIndex = 0; arrayIndex 0 arrayIndex < n arrayIndex n arrayIndex++ arrayIndex++ arrayIndex {
			nums[arrayIndex] = sc.nextInt();
		} {
			nums[arrayIndex] = sc.nextInt();
		} nums[arrayIndex] = sc.nextInt() nums[arrayIndex] nums arrayIndex sc.nextInt() sc.nextInt sc int swapCount = 0; swapCount 0 for(int index = 0; index < n; index++) {
			int minj = index;
			for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			}
			if(index != minj) {
				swapCount++;
			}
			int work = nums[index];
			nums[index] = nums[minj];
			nums[minj] = work;
		} int index = 0; int index = 0; index 0 index < n index n index++ index++ index {
			int minj = index;
			for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			}
			if(index != minj) {
				swapCount++;
			}
			int work = nums[index];
			nums[index] = nums[minj];
			nums[minj] = work;
		} {
			int minj = index;
			for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			}
			if(index != minj) {
				swapCount++;
			}
			int work = nums[index];
			nums[index] = nums[minj];
			nums[minj] = work;
		} int minj = index; minj index for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			} int j = index; int j = index; j index j < n j n j++ j++ j {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			} {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			} if(nums[j] < nums[minj]) {
					minj = j;
				} nums[j] < nums[minj] nums[j] nums j nums[minj] nums minj {
					minj = j;
				} minj = j minj j if(index != minj) {
				swapCount++;
			} index != minj index minj {
				swapCount++;
			} swapCount++ swapCount int work = nums[index]; work nums[index] nums index nums[index] = nums[minj] nums[index] nums index nums[minj] nums minj nums[minj] = work nums[minj] nums minj work printArray(nums) printArray nums System.out.println(swapCount) System.out.println System.out System System.out swapCount String[] args args public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	} printArray {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	} int arrayLength = array.length; arrayLength array.length array array.length for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		} int index = 0; int index = 0; index 0 index < arrayLength - 1 index arrayLength - 1 arrayLength 1 index++ index++ index {
			System.out.print(array[index] + " ");
		} {
			System.out.print(array[index] + " ");
		} System.out.print(array[index] + " ") System.out.print System.out System System.out array[index] + " " array[index] array index " " System.out.println(array[arrayLength - 1]) System.out.println System.out System System.out array[arrayLength - 1] array arrayLength - 1 arrayLength 1 int[] array array public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		int swapCount = 0;
		for(int index = 0; index < n; index++) {
			int minj = index;
			for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			}
			if(index != minj) {
				swapCount++;
			}
			int work = nums[index];
			nums[index] = nums[minj];
			nums[minj] = work;
		}
		printArray(nums);
		System.out.println(swapCount);
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		int swapCount = 0;
		for(int index = 0; index < n; index++) {
			int minj = index;
			for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			}
			if(index != minj) {
				swapCount++;
			}
			int work = nums[index];
			nums[index] = nums[minj];
			nums[minj] = work;
		}
		printArray(nums);
		System.out.println(swapCount);
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		int swapCount = 0;
		for(int index = 0; index < n; index++) {
			int minj = index;
			for(int j = index; j < n; j++) {
				if(nums[j] < nums[minj]) {
					minj = j;
				}
			}
			if(index != minj) {
				swapCount++;
			}
			int work = nums[index];
			nums[index] = nums[minj];
			nums[minj] = work;
		}
		printArray(nums);
		System.out.println(swapCount);
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
}