import java.util.Scanner;

public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] k = line2.split(" ");
		for (int i = 0; i < v; i++) {
			vs[i] = Integer.parseInt(k[i]);
		}
		int count = 0;
		for (int i = 0; i < v; i++) {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		}
		for (int i = 0; i < v - 1; i++) {
			System.out.print(vs[i]+" ");
		}
		System.out.println(vs[v - 1]);
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] k = line2.split(" ");
		for (int i = 0; i < v; i++) {
			vs[i] = Integer.parseInt(k[i]);
		}
		int count = 0;
		for (int i = 0; i < v; i++) {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		}
		for (int i = 0; i < v - 1; i++) {
			System.out.print(vs[i]+" ");
		}
		System.out.println(vs[v - 1]);
		System.out.println(count);
	}
} Main public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] k = line2.split(" ");
		for (int i = 0; i < v; i++) {
			vs[i] = Integer.parseInt(k[i]);
		}
		int count = 0;
		for (int i = 0; i < v; i++) {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		}
		for (int i = 0; i < v - 1; i++) {
			System.out.print(vs[i]+" ");
		}
		System.out.println(vs[v - 1]);
		System.out.println(count);
	} main {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] k = line2.split(" ");
		for (int i = 0; i < v; i++) {
			vs[i] = Integer.parseInt(k[i]);
		}
		int count = 0;
		for (int i = 0; i < v; i++) {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		}
		for (int i = 0; i < v - 1; i++) {
			System.out.print(vs[i]+" ");
		}
		System.out.println(vs[v - 1]);
		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int v = Integer.parseInt(line); v Integer.parseInt(line) Integer.parseInt Integer line int[] vs = new int[v]; vs new int[v] v String line2 = sc.nextLine(); line2 sc.nextLine() sc.nextLine sc String[] k = line2.split(" "); k line2.split(" ") line2.split line2 " " for (int i = 0; i < v; i++) {
			vs[i] = Integer.parseInt(k[i]);
		} int i = 0; int i = 0; i 0 i < v i v i++ i++ i {
			vs[i] = Integer.parseInt(k[i]);
		} {
			vs[i] = Integer.parseInt(k[i]);
		} vs[i] = Integer.parseInt(k[i]) vs[i] vs i Integer.parseInt(k[i]) Integer.parseInt Integer k[i] k i int count = 0; count 0 for (int i = 0; i < v; i++) {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		} int i = 0; int i = 0; i 0 i < v i v i++ i++ i {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		} {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		} int min = i; min i for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			} int l = i; int l = i; l i l < v l v l++ l++ l {
				if (vs[min] > vs[l]) {
					min = l;
				}
			} {
				if (vs[min] > vs[l]) {
					min = l;
				}
			} if (vs[min] > vs[l]) {
					min = l;
				} vs[min] > vs[l] vs[min] vs min vs[l] vs l {
					min = l;
				} min = l min l if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			} min != i min i {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			} int a =vs[min]; a vs[min] vs min int b = vs[i]; b vs[i] vs i vs[min]=b vs[min] vs min b vs[i]=a vs[i] vs i a count++ count for (int i = 0; i < v - 1; i++) {
			System.out.print(vs[i]+" ");
		} int i = 0; int i = 0; i 0 i < v - 1 i v - 1 v 1 i++ i++ i {
			System.out.print(vs[i]+" ");
		} {
			System.out.print(vs[i]+" ");
		} System.out.print(vs[i]+" ") System.out.print System.out System System.out vs[i]+" " vs[i] vs i " " System.out.println(vs[v - 1]) System.out.println System.out System System.out vs[v - 1] vs v - 1 v 1 System.out.println(count) System.out.println System.out System System.out count String[] arges arges public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] k = line2.split(" ");
		for (int i = 0; i < v; i++) {
			vs[i] = Integer.parseInt(k[i]);
		}
		int count = 0;
		for (int i = 0; i < v; i++) {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		}
		for (int i = 0; i < v - 1; i++) {
			System.out.print(vs[i]+" ");
		}
		System.out.println(vs[v - 1]);
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] k = line2.split(" ");
		for (int i = 0; i < v; i++) {
			vs[i] = Integer.parseInt(k[i]);
		}
		int count = 0;
		for (int i = 0; i < v; i++) {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		}
		for (int i = 0; i < v - 1; i++) {
			System.out.print(vs[i]+" ");
		}
		System.out.println(vs[v - 1]);
		System.out.println(count);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] k = line2.split(" ");
		for (int i = 0; i < v; i++) {
			vs[i] = Integer.parseInt(k[i]);
		}
		int count = 0;
		for (int i = 0; i < v; i++) {
			int min = i;

			for (int l = i; l < v; l++) {
				if (vs[min] > vs[l]) {
					min = l;
				}
			}
			if (min != i) {
				int a =vs[min];
				int b = vs[i];
				vs[min]=b;
				vs[i]=a;
				count++;
			}
		}
		for (int i = 0; i < v - 1; i++) {
			System.out.print(vs[i]+" ");
		}
		System.out.println(vs[v - 1]);
		System.out.println(count);
	}
}