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

public class Main {
	public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int progNumLength = Integer.parseInt(br.readLine());

		String[] progNum = br.readLine().split(" ");

		int[] progNumResult = new int[progNumLength];

		for(int i = 0; i < progNumLength; i++) {
			progNumResult[i] = Integer.parseInt(progNum[i]);
		}

		int minNum = 0;
		int sortCount = 0;
		for(int i = 0; i < progNumLength; i++) {
			minNum = i;

			for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			}
			if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			}
		}
		printArray(progNumResult);
		System.out.println(sortCount);
	}

} 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 printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int progNumLength = Integer.parseInt(br.readLine());

		String[] progNum = br.readLine().split(" ");

		int[] progNumResult = new int[progNumLength];

		for(int i = 0; i < progNumLength; i++) {
			progNumResult[i] = Integer.parseInt(progNum[i]);
		}

		int minNum = 0;
		int sortCount = 0;
		for(int i = 0; i < progNumLength; i++) {
			minNum = i;

			for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			}
			if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			}
		}
		printArray(progNumResult);
		System.out.println(sortCount);
	}

} Main public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	} printArray {
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	} for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		} int i = 0; int i = 0; i 0 i < intArray.length i intArray.length intArray intArray.length i++ i++ i {
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		} {
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		} System.out.print(intArray[i]) System.out.print System.out System System.out intArray[i] intArray i if (i == intArray.length - 1){
				break;
			} i == intArray.length - 1 i intArray.length - 1 intArray.length intArray intArray.length 1 {
				break;
			} break; System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out int[] intArray intArray public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int progNumLength = Integer.parseInt(br.readLine());

		String[] progNum = br.readLine().split(" ");

		int[] progNumResult = new int[progNumLength];

		for(int i = 0; i < progNumLength; i++) {
			progNumResult[i] = Integer.parseInt(progNum[i]);
		}

		int minNum = 0;
		int sortCount = 0;
		for(int i = 0; i < progNumLength; i++) {
			minNum = i;

			for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			}
			if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			}
		}
		printArray(progNumResult);
		System.out.println(sortCount);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int progNumLength = Integer.parseInt(br.readLine());

		String[] progNum = br.readLine().split(" ");

		int[] progNumResult = new int[progNumLength];

		for(int i = 0; i < progNumLength; i++) {
			progNumResult[i] = Integer.parseInt(progNum[i]);
		}

		int minNum = 0;
		int sortCount = 0;
		for(int i = 0; i < progNumLength; i++) {
			minNum = i;

			for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			}
			if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			}
		}
		printArray(progNumResult);
		System.out.println(sortCount);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int progNumLength = Integer.parseInt(br.readLine()); progNumLength Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] progNum = br.readLine().split(" "); progNum br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] progNumResult = new int[progNumLength]; progNumResult new int[progNumLength] progNumLength for(int i = 0; i < progNumLength; i++) {
			progNumResult[i] = Integer.parseInt(progNum[i]);
		} int i = 0; int i = 0; i 0 i < progNumLength i progNumLength i++ i++ i {
			progNumResult[i] = Integer.parseInt(progNum[i]);
		} {
			progNumResult[i] = Integer.parseInt(progNum[i]);
		} progNumResult[i] = Integer.parseInt(progNum[i]) progNumResult[i] progNumResult i Integer.parseInt(progNum[i]) Integer.parseInt Integer progNum[i] progNum i int minNum = 0; minNum 0 int sortCount = 0; sortCount 0 for(int i = 0; i < progNumLength; i++) {
			minNum = i;

			for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			}
			if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			}
		} int i = 0; int i = 0; i 0 i < progNumLength i progNumLength i++ i++ i {
			minNum = i;

			for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			}
			if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			}
		} {
			minNum = i;

			for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			}
			if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			}
		} minNum = i minNum i for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			} int j = i; int j = i; j i j < progNumLength j progNumLength j++ j++ j {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			} {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			} if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				} progNumResult[j] < progNumResult[minNum] progNumResult[j] progNumResult j progNumResult[minNum] progNumResult minNum {
					minNum = j;
				} minNum = j minNum j if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			} i != minNum i minNum {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			} int tmp = progNumResult[i]; tmp progNumResult[i] progNumResult i progNumResult[i] = progNumResult[minNum] progNumResult[i] progNumResult i progNumResult[minNum] progNumResult minNum progNumResult[minNum] = tmp progNumResult[minNum] progNumResult minNum tmp sortCount++ sortCount printArray(progNumResult) printArray progNumResult System.out.println(sortCount) System.out.println System.out System System.out sortCount String[] args args public class Main {
	public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int progNumLength = Integer.parseInt(br.readLine());

		String[] progNum = br.readLine().split(" ");

		int[] progNumResult = new int[progNumLength];

		for(int i = 0; i < progNumLength; i++) {
			progNumResult[i] = Integer.parseInt(progNum[i]);
		}

		int minNum = 0;
		int sortCount = 0;
		for(int i = 0; i < progNumLength; i++) {
			minNum = i;

			for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			}
			if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			}
		}
		printArray(progNumResult);
		System.out.println(sortCount);
	}

} public class Main {
	public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int progNumLength = Integer.parseInt(br.readLine());

		String[] progNum = br.readLine().split(" ");

		int[] progNumResult = new int[progNumLength];

		for(int i = 0; i < progNumLength; i++) {
			progNumResult[i] = Integer.parseInt(progNum[i]);
		}

		int minNum = 0;
		int sortCount = 0;
		for(int i = 0; i < progNumLength; i++) {
			minNum = i;

			for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			}
			if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			}
		}
		printArray(progNumResult);
		System.out.println(sortCount);
	}

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

public class Main {
	public static void printArray(int[] intArray){
		for (int i = 0; i < intArray.length; i++){
			System.out.print(intArray[i]);

			if (i == intArray.length - 1){
				break;
			}
			System.out.print(" ");
		}
		System.out.println();
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int progNumLength = Integer.parseInt(br.readLine());

		String[] progNum = br.readLine().split(" ");

		int[] progNumResult = new int[progNumLength];

		for(int i = 0; i < progNumLength; i++) {
			progNumResult[i] = Integer.parseInt(progNum[i]);
		}

		int minNum = 0;
		int sortCount = 0;
		for(int i = 0; i < progNumLength; i++) {
			minNum = i;

			for(int j = i; j < progNumLength; j++) {
				if(progNumResult[j] < progNumResult[minNum]) {
					minNum = j;
				}
			}
			if(i != minNum) {
				int tmp = progNumResult[i];
				progNumResult[i] = progNumResult[minNum];
				progNumResult[minNum] = tmp;

				sortCount++;
			}
		}
		printArray(progNumResult);
		System.out.println(sortCount);
	}

}