import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len];
		int count = 0;

		for (int i = 0; i < nums.length; i++) {
			nums[i] = scanner.nextInt();
		}

		int minIdx = 0;

		for (int j = 0; j < nums.length; j++) {
			minIdx = j;
			for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			}
			if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			}
		}
		new Main().arrayToString(nums);
		System.out.println(count);
	}

	public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {

			if (i == arr.length - 1) {
				System.out.println(arr[i]);
			} else {
				System.out.print(arr[i] + " ");
			}
		}
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len];
		int count = 0;

		for (int i = 0; i < nums.length; i++) {
			nums[i] = scanner.nextInt();
		}

		int minIdx = 0;

		for (int j = 0; j < nums.length; j++) {
			minIdx = j;
			for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			}
			if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			}
		}
		new Main().arrayToString(nums);
		System.out.println(count);
	}

	public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {

			if (i == arr.length - 1) {
				System.out.println(arr[i]);
			} else {
				System.out.print(arr[i] + " ");
			}
		}
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len];
		int count = 0;

		for (int i = 0; i < nums.length; i++) {
			nums[i] = scanner.nextInt();
		}

		int minIdx = 0;

		for (int j = 0; j < nums.length; j++) {
			minIdx = j;
			for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			}
			if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			}
		}
		new Main().arrayToString(nums);
		System.out.println(count);
	} main {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len];
		int count = 0;

		for (int i = 0; i < nums.length; i++) {
			nums[i] = scanner.nextInt();
		}

		int minIdx = 0;

		for (int j = 0; j < nums.length; j++) {
			minIdx = j;
			for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			}
			if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			}
		}
		new Main().arrayToString(nums);
		System.out.println(count);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int len = scanner.nextInt(); len scanner.nextInt() scanner.nextInt scanner int nums[] = new int[len]; nums new int[len] len int count = 0; count 0 for (int i = 0; i < nums.length; i++) {
			nums[i] = scanner.nextInt();
		} int i = 0; int i = 0; i 0 i < nums.length i nums.length nums nums.length i++ i++ i {
			nums[i] = scanner.nextInt();
		} {
			nums[i] = scanner.nextInt();
		} nums[i] = scanner.nextInt() nums[i] nums i scanner.nextInt() scanner.nextInt scanner int minIdx = 0; minIdx 0 for (int j = 0; j < nums.length; j++) {
			minIdx = j;
			for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			}
			if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			}
		} int j = 0; int j = 0; j 0 j < nums.length j nums.length nums nums.length j++ j++ j {
			minIdx = j;
			for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			}
			if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			}
		} {
			minIdx = j;
			for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			}
			if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			}
		} minIdx = j minIdx j for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			} int j2 = j; int j2 = j; j2 j j2 < nums.length j2 nums.length nums nums.length j2++ j2++ j2 {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			} {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			} if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				} nums[j2] < nums[minIdx] nums[j2] nums j2 nums[minIdx] nums minIdx {
					minIdx = j2;
				} minIdx = j2 minIdx j2 if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			} minIdx != j minIdx j {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			} int minValue = nums[minIdx]; minValue nums[minIdx] nums minIdx nums[minIdx] = nums[j] nums[minIdx] nums minIdx nums[j] nums j nums[j] = minValue nums[j] nums j minValue count++ count new Main().arrayToString(nums) new Main().arrayToString new Main() nums System.out.println(count) System.out.println System.out System System.out count String[] args args public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {

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

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

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

			if (i == arr.length - 1) {
				System.out.println(arr[i]);
			} else {
				System.out.print(arr[i] + " ");
			}
		} {

			if (i == arr.length - 1) {
				System.out.println(arr[i]);
			} else {
				System.out.print(arr[i] + " ");
			}
		} if (i == arr.length - 1) {
				System.out.println(arr[i]);
			} else {
				System.out.print(arr[i] + " ");
			} i == arr.length - 1 i arr.length - 1 arr.length arr arr.length 1 {
				System.out.println(arr[i]);
			} System.out.println(arr[i]) System.out.println System.out System System.out arr[i] arr i {
				System.out.print(arr[i] + " ");
			} System.out.print(arr[i] + " ") System.out.print System.out System System.out arr[i] + " " arr[i] arr i " " int[] arr arr public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len];
		int count = 0;

		for (int i = 0; i < nums.length; i++) {
			nums[i] = scanner.nextInt();
		}

		int minIdx = 0;

		for (int j = 0; j < nums.length; j++) {
			minIdx = j;
			for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			}
			if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			}
		}
		new Main().arrayToString(nums);
		System.out.println(count);
	}

	public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {

			if (i == arr.length - 1) {
				System.out.println(arr[i]);
			} else {
				System.out.print(arr[i] + " ");
			}
		}
	}

} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len];
		int count = 0;

		for (int i = 0; i < nums.length; i++) {
			nums[i] = scanner.nextInt();
		}

		int minIdx = 0;

		for (int j = 0; j < nums.length; j++) {
			minIdx = j;
			for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			}
			if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			}
		}
		new Main().arrayToString(nums);
		System.out.println(count);
	}

	public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {

			if (i == arr.length - 1) {
				System.out.println(arr[i]);
			} else {
				System.out.print(arr[i] + " ");
			}
		}
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len];
		int count = 0;

		for (int i = 0; i < nums.length; i++) {
			nums[i] = scanner.nextInt();
		}

		int minIdx = 0;

		for (int j = 0; j < nums.length; j++) {
			minIdx = j;
			for (int j2 = j; j2 < nums.length; j2++) {
				if (nums[j2] < nums[minIdx]) {
					minIdx = j2;
				}
			}
			if (minIdx != j) {
				int minValue = nums[minIdx];
				nums[minIdx] = nums[j];
				nums[j] = minValue;
				count++;
			}
		}
		new Main().arrayToString(nums);
		System.out.println(count);
	}

	public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {

			if (i == arr.length - 1) {
				System.out.println(arr[i]);
			} else {
				System.out.print(arr[i] + " ");
			}
		}
	}

}
