import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int num = sc.nextInt();
		int[] arr = new int[num];
		for (int i = 0; i < num; i++) {
			arr[i] = sc.nextInt();
		}
		
		int countChange = 0;
		for (int i = 0; i < num; i++) {
			int minj = i;
			int j;
			for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			}
			
			if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			}
		}
		
		
		for (int i = 0; i < num; i++) {
			System.out.print(arr[i]);
			if (i != num - 1)
				System.out.print(" ");
		}
		System.out.println("");
		System.out.println(countChange);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int num = sc.nextInt();
		int[] arr = new int[num];
		for (int i = 0; i < num; i++) {
			arr[i] = sc.nextInt();
		}
		
		int countChange = 0;
		for (int i = 0; i < num; i++) {
			int minj = i;
			int j;
			for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			}
			
			if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			}
		}
		
		
		for (int i = 0; i < num; i++) {
			System.out.print(arr[i]);
			if (i != num - 1)
				System.out.print(" ");
		}
		System.out.println("");
		System.out.println(countChange);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int num = sc.nextInt();
		int[] arr = new int[num];
		for (int i = 0; i < num; i++) {
			arr[i] = sc.nextInt();
		}
		
		int countChange = 0;
		for (int i = 0; i < num; i++) {
			int minj = i;
			int j;
			for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			}
			
			if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			}
		}
		
		
		for (int i = 0; i < num; i++) {
			System.out.print(arr[i]);
			if (i != num - 1)
				System.out.print(" ");
		}
		System.out.println("");
		System.out.println(countChange);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int num = sc.nextInt();
		int[] arr = new int[num];
		for (int i = 0; i < num; i++) {
			arr[i] = sc.nextInt();
		}
		
		int countChange = 0;
		for (int i = 0; i < num; i++) {
			int minj = i;
			int j;
			for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			}
			
			if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			}
		}
		
		
		for (int i = 0; i < num; i++) {
			System.out.print(arr[i]);
			if (i != num - 1)
				System.out.print(" ");
		}
		System.out.println("");
		System.out.println(countChange);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int[] arr = new int[num]; arr new int[num] num for (int i = 0; i < num; i++) {
			arr[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			arr[i] = sc.nextInt();
		} {
			arr[i] = sc.nextInt();
		} arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc int countChange = 0; countChange 0 for (int i = 0; i < num; i++) {
			int minj = i;
			int j;
			for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			}
			
			if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			}
		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			int minj = i;
			int j;
			for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			}
			
			if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			}
		} {
			int minj = i;
			int j;
			for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			}
			
			if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			}
		} int minj = i; minj i int j; j for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			} j = i; j = i j i j < num j num j++ j++ j {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			} {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			} if (arr[j] < arr[minj]) {
					minj = j;
				} arr[j] < arr[minj] arr[j] arr j arr[minj] arr minj {
					minj = j;
				} minj = j minj j if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			} i != minj i minj {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			} int temp = arr[i]; temp arr[i] arr i arr[i] = arr[minj] arr[i] arr i arr[minj] arr minj arr[minj] = temp arr[minj] arr minj temp countChange++ countChange for (int i = 0; i < num; i++) {
			System.out.print(arr[i]);
			if (i != num - 1)
				System.out.print(" ");
		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			System.out.print(arr[i]);
			if (i != num - 1)
				System.out.print(" ");
		} {
			System.out.print(arr[i]);
			if (i != num - 1)
				System.out.print(" ");
		} System.out.print(arr[i]) System.out.print System.out System System.out arr[i] arr i if (i != num - 1)
				System.out.print(" "); i != num - 1 i num - 1 num 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println("") System.out.println System.out System System.out "" System.out.println(countChange) System.out.println System.out System System.out countChange String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int num = sc.nextInt();
		int[] arr = new int[num];
		for (int i = 0; i < num; i++) {
			arr[i] = sc.nextInt();
		}
		
		int countChange = 0;
		for (int i = 0; i < num; i++) {
			int minj = i;
			int j;
			for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			}
			
			if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			}
		}
		
		
		for (int i = 0; i < num; i++) {
			System.out.print(arr[i]);
			if (i != num - 1)
				System.out.print(" ");
		}
		System.out.println("");
		System.out.println(countChange);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int num = sc.nextInt();
		int[] arr = new int[num];
		for (int i = 0; i < num; i++) {
			arr[i] = sc.nextInt();
		}
		
		int countChange = 0;
		for (int i = 0; i < num; i++) {
			int minj = i;
			int j;
			for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			}
			
			if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			}
		}
		
		
		for (int i = 0; i < num; i++) {
			System.out.print(arr[i]);
			if (i != num - 1)
				System.out.print(" ");
		}
		System.out.println("");
		System.out.println(countChange);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int num = sc.nextInt();
		int[] arr = new int[num];
		for (int i = 0; i < num; i++) {
			arr[i] = sc.nextInt();
		}
		
		int countChange = 0;
		for (int i = 0; i < num; i++) {
			int minj = i;
			int j;
			for (j = i; j < num; j++) {
				if (arr[j] < arr[minj]) {
					minj = j;
				}
			}
			
			if (i != minj) {
				int temp = arr[i];
				arr[i] = arr[minj];
				arr[minj] = temp;
				countChange++;
			}
		}
		
		
		for (int i = 0; i < num; i++) {
			System.out.print(arr[i]);
			if (i != num - 1)
				System.out.print(" ");
		}
		System.out.println("");
		System.out.println(countChange);
	}
}