import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);
	StringBuilder out;

	void run() {
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
		}

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		}
		for (int i = 0; i < A.length; i++) {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		}
		System.out.println("\n" + cnt);
	}

	public static void main(String[] args) {
		new Main().run();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	Scanner sc = new Scanner(System.in);
	StringBuilder out;

	void run() {
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
		}

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		}
		for (int i = 0; i < A.length; i++) {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		}
		System.out.println("\n" + cnt);
	}

	public static void main(String[] args) {
		new Main().run();
	}
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder out; out void run() {
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
		}

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		}
		for (int i = 0; i < A.length; i++) {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		}
		System.out.println("\n" + cnt);
	} run {
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
		}

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		}
		for (int i = 0; i < A.length; i++) {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		}
		System.out.println("\n" + cnt);
	} int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] A = new int[N]; A new int[N] N for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < A.length i A.length A A.length i++ i++ i {
			A[i] = sc.nextInt();
		} {
			A[i] = sc.nextInt();
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 for (int i = 0; i < N; i++) {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		} {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		} boolean swap = false; swap false int min = i; min i for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			} int j = i + 1; int j = i + 1; j i + 1 i 1 j < N j N j++ j++ j {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			} {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			} if (A[j] < A[min]) {
					min = j;
					swap = true;
				} A[j] < A[min] A[j] A j A[min] A min {
					min = j;
					swap = true;
				} min = j min j swap = true swap true if (swap) {
				cnt++;
			} swap {
				cnt++;
			} cnt++ cnt int tmp = A[i]; tmp A[i] A i A[i] = A[min] A[i] A i A[min] A min A[min] = tmp A[min] A min tmp for (int i = 0; i < A.length; i++) {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		} int i = 0; int i = 0; i 0 i < A.length i A.length A A.length i++ i++ i {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		} {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		} System.out.print((i == 0 ? "" : " ") + A[i]) System.out.print System.out System System.out (i == 0 ? "" : " ") + A[i] (i == 0 ? "" : " ") i == 0 i 0 "" " " A[i] A i System.out.println("\n" + cnt) System.out.println System.out System System.out "\n" + cnt "\n" cnt public static void main(String[] args) {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args public class Main {
	Scanner sc = new Scanner(System.in);
	StringBuilder out;

	void run() {
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
		}

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		}
		for (int i = 0; i < A.length; i++) {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		}
		System.out.println("\n" + cnt);
	}

	public static void main(String[] args) {
		new Main().run();
	}
} public class Main {
	Scanner sc = new Scanner(System.in);
	StringBuilder out;

	void run() {
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
		}

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		}
		for (int i = 0; i < A.length; i++) {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		}
		System.out.println("\n" + cnt);
	}

	public static void main(String[] args) {
		new Main().run();
	}
} Main
import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);
	StringBuilder out;

	void run() {
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < A.length; i++) {
			A[i] = sc.nextInt();
		}

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			boolean swap = false;
			int min = i;
			for (int j = i + 1; j < N; j++) {
				if (A[j] < A[min]) {
					min = j;
					swap = true;
				}
			}
			if (swap) {
				cnt++;
			}
			int tmp = A[i];
			A[i] = A[min];
			A[min] = tmp;
		}
		for (int i = 0; i < A.length; i++) {
			System.out.print((i == 0 ? "" : " ") + A[i]);
		}
		System.out.println("\n" + cnt);
	}

	public static void main(String[] args) {
		new Main().run();
	}
}