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

public class Main {
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		byte min, count = 0, arrayLength = Byte.parseByte(in.readLine());
		byte[] array = new byte[arrayLength];
		String[] strData = in.readLine().split(" ");
		for (int i = 0; i < arrayLength; i++) {
			array[i] = Byte.parseByte(strData[i]);
		}
		for (byte x = 0; x < arrayLength; x++) {
			min = x;
			for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			}
			if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			}
		}
		for (int j = 0; j < arrayLength; j++) {
			if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			}
		}
		System.out.println(count);
	}
} 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 NumberFormatException,
			IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		byte min, count = 0, arrayLength = Byte.parseByte(in.readLine());
		byte[] array = new byte[arrayLength];
		String[] strData = in.readLine().split(" ");
		for (int i = 0; i < arrayLength; i++) {
			array[i] = Byte.parseByte(strData[i]);
		}
		for (byte x = 0; x < arrayLength; x++) {
			min = x;
			for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			}
			if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			}
		}
		for (int j = 0; j < arrayLength; j++) {
			if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		byte min, count = 0, arrayLength = Byte.parseByte(in.readLine());
		byte[] array = new byte[arrayLength];
		String[] strData = in.readLine().split(" ");
		for (int i = 0; i < arrayLength; i++) {
			array[i] = Byte.parseByte(strData[i]);
		}
		for (byte x = 0; x < arrayLength; x++) {
			min = x;
			for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			}
			if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			}
		}
		for (int j = 0; j < arrayLength; j++) {
			if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			}
		}
		System.out.println(count);
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		byte min, count = 0, arrayLength = Byte.parseByte(in.readLine());
		byte[] array = new byte[arrayLength];
		String[] strData = in.readLine().split(" ");
		for (int i = 0; i < arrayLength; i++) {
			array[i] = Byte.parseByte(strData[i]);
		}
		for (byte x = 0; x < arrayLength; x++) {
			min = x;
			for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			}
			if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			}
		}
		for (int j = 0; j < arrayLength; j++) {
			if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			}
		}
		System.out.println(count);
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) byte min min count = 0 count 0 arrayLength = Byte.parseByte(in.readLine()); arrayLength Byte.parseByte(in.readLine()) Byte.parseByte Byte in.readLine() in.readLine in byte[] array = new byte[arrayLength]; array new byte[arrayLength] arrayLength String[] strData = in.readLine().split(" "); strData in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " for (int i = 0; i < arrayLength; i++) {
			array[i] = Byte.parseByte(strData[i]);
		} int i = 0; int i = 0; i 0 i < arrayLength i arrayLength i++ i++ i {
			array[i] = Byte.parseByte(strData[i]);
		} {
			array[i] = Byte.parseByte(strData[i]);
		} array[i] = Byte.parseByte(strData[i]) array[i] array i Byte.parseByte(strData[i]) Byte.parseByte Byte strData[i] strData i for (byte x = 0; x < arrayLength; x++) {
			min = x;
			for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			}
			if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			}
		} byte x = 0; byte x = 0; x 0 x < arrayLength x arrayLength x++ x++ x {
			min = x;
			for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			}
			if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			}
		} {
			min = x;
			for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			}
			if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			}
		} min = x min x for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			} byte y = (byte) (x + 1); byte y = (byte) (x + 1); y (byte) (x + 1) x 1 y < arrayLength y arrayLength y++ y++ y {
				if (array[min] > array[y]) {
					min = y;
				}
			} {
				if (array[min] > array[y]) {
					min = y;
				}
			} if (array[min] > array[y]) {
					min = y;
				} array[min] > array[y] array[min] array min array[y] array y {
					min = y;
				} min = y min y if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			} array[x] > array[min] array[x] array x array[min] array min {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			} byte temp = array[x]; temp array[x] array x array[x] = array[min] array[x] array x array[min] array min array[min] = temp array[min] array min temp count++ count for (int j = 0; j < arrayLength; j++) {
			if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			}
		} int j = 0; int j = 0; j 0 j < arrayLength j arrayLength j++ j++ j {
			if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			}
		} {
			if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			}
		} if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			} j == arrayLength - 1 j arrayLength - 1 arrayLength 1 {
				System.out.println(array[j]);
			} System.out.println(array[j]) System.out.println System.out System System.out array[j] array j {
				System.out.print(array[j] + " ");
			} System.out.print(array[j] + " ") System.out.print System.out System System.out array[j] + " " array[j] array j " " System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		byte min, count = 0, arrayLength = Byte.parseByte(in.readLine());
		byte[] array = new byte[arrayLength];
		String[] strData = in.readLine().split(" ");
		for (int i = 0; i < arrayLength; i++) {
			array[i] = Byte.parseByte(strData[i]);
		}
		for (byte x = 0; x < arrayLength; x++) {
			min = x;
			for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			}
			if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			}
		}
		for (int j = 0; j < arrayLength; j++) {
			if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			}
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		byte min, count = 0, arrayLength = Byte.parseByte(in.readLine());
		byte[] array = new byte[arrayLength];
		String[] strData = in.readLine().split(" ");
		for (int i = 0; i < arrayLength; i++) {
			array[i] = Byte.parseByte(strData[i]);
		}
		for (byte x = 0; x < arrayLength; x++) {
			min = x;
			for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			}
			if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			}
		}
		for (int j = 0; j < arrayLength; j++) {
			if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			}
		}
		System.out.println(count);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		byte min, count = 0, arrayLength = Byte.parseByte(in.readLine());
		byte[] array = new byte[arrayLength];
		String[] strData = in.readLine().split(" ");
		for (int i = 0; i < arrayLength; i++) {
			array[i] = Byte.parseByte(strData[i]);
		}
		for (byte x = 0; x < arrayLength; x++) {
			min = x;
			for (byte y = (byte) (x + 1); y < arrayLength; y++) {
				if (array[min] > array[y]) {
					min = y;
				}
			}
			if (array[x] > array[min]) {
				byte temp = array[x];
				array[x] = array[min];
				array[min] = temp;
				count++;
			}
		}
		for (int j = 0; j < arrayLength; j++) {
			if (j == arrayLength - 1) {
				System.out.println(array[j]);
			} else {
				System.out.print(array[j] + " ");
			}
		}
		System.out.println(count);
	}
}