import java.util.Scanner;
public class Main {
	int n,cnt;
	int[] ary;
	public static void main(String args[]) {
		new Main().run();
	}
	public void run() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		cnt = 0;
		ary = new int[n];
		for (int i = 0; i < n; i++) {
			ary[i] = scan.nextInt();
		}
		for (int i = 0; i < n; i++) {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			}
			if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			}
		}
		writeArray();
		System.out.println(cnt);
	}
	public void writeArray() {
		System.out.print(ary[0]);
		for (int i = 1; i < n; i++) {
			System.out.print(" " + ary[i]);
		}
		System.out.println();
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	int n,cnt;
	int[] ary;
	public static void main(String args[]) {
		new Main().run();
	}
	public void run() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		cnt = 0;
		ary = new int[n];
		for (int i = 0; i < n; i++) {
			ary[i] = scan.nextInt();
		}
		for (int i = 0; i < n; i++) {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			}
			if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			}
		}
		writeArray();
		System.out.println(cnt);
	}
	public void writeArray() {
		System.out.print(ary[0]);
		for (int i = 1; i < n; i++) {
			System.out.print(" " + ary[i]);
		}
		System.out.println();
	}
} Main int n n cnt; cnt int[] ary; ary 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 void run() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		cnt = 0;
		ary = new int[n];
		for (int i = 0; i < n; i++) {
			ary[i] = scan.nextInt();
		}
		for (int i = 0; i < n; i++) {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			}
			if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			}
		}
		writeArray();
		System.out.println(cnt);
	} run {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		cnt = 0;
		ary = new int[n];
		for (int i = 0; i < n; i++) {
			ary[i] = scan.nextInt();
		}
		for (int i = 0; i < n; i++) {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			}
			if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			}
		}
		writeArray();
		System.out.println(cnt);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) n = scan.nextInt() n scan.nextInt() scan.nextInt scan cnt = 0 cnt 0 ary = new int[n] ary new int[n] n for (int i = 0; i < n; i++) {
			ary[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			ary[i] = scan.nextInt();
		} {
			ary[i] = scan.nextInt();
		} ary[i] = scan.nextInt() ary[i] ary i scan.nextInt() scan.nextInt scan for (int i = 0; i < n; i++) {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			}
			if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			}
			if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			}
		} {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			}
			if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			}
		} int minj = i; minj i for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			} int j = i; int j = i; j i j < n j n j++ j++ j {
				if (ary[minj] > ary[j])
					minj = j;
			} {
				if (ary[minj] > ary[j])
					minj = j;
			} if (ary[minj] > ary[j])
					minj = j; ary[minj] > ary[j] ary[minj] ary minj ary[j] ary j minj = j minj j if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			} i != minj i minj {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			} int tmp = ary[i]; tmp ary[i] ary i ary[i] = ary[minj] ary[i] ary i ary[minj] ary minj ary[minj] = tmp ary[minj] ary minj tmp cnt++ cnt writeArray() writeArray System.out.println(cnt) System.out.println System.out System System.out cnt public void writeArray() {
		System.out.print(ary[0]);
		for (int i = 1; i < n; i++) {
			System.out.print(" " + ary[i]);
		}
		System.out.println();
	} writeArray {
		System.out.print(ary[0]);
		for (int i = 1; i < n; i++) {
			System.out.print(" " + ary[i]);
		}
		System.out.println();
	} System.out.print(ary[0]) System.out.print System.out System System.out ary[0] ary 0 for (int i = 1; i < n; i++) {
			System.out.print(" " + ary[i]);
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			System.out.print(" " + ary[i]);
		} {
			System.out.print(" " + ary[i]);
		} System.out.print(" " + ary[i]) System.out.print System.out System System.out " " + ary[i] " " ary[i] ary i System.out.println() System.out.println System.out System System.out public class Main {
	int n,cnt;
	int[] ary;
	public static void main(String args[]) {
		new Main().run();
	}
	public void run() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		cnt = 0;
		ary = new int[n];
		for (int i = 0; i < n; i++) {
			ary[i] = scan.nextInt();
		}
		for (int i = 0; i < n; i++) {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			}
			if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			}
		}
		writeArray();
		System.out.println(cnt);
	}
	public void writeArray() {
		System.out.print(ary[0]);
		for (int i = 1; i < n; i++) {
			System.out.print(" " + ary[i]);
		}
		System.out.println();
	}
} public class Main {
	int n,cnt;
	int[] ary;
	public static void main(String args[]) {
		new Main().run();
	}
	public void run() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		cnt = 0;
		ary = new int[n];
		for (int i = 0; i < n; i++) {
			ary[i] = scan.nextInt();
		}
		for (int i = 0; i < n; i++) {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			}
			if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			}
		}
		writeArray();
		System.out.println(cnt);
	}
	public void writeArray() {
		System.out.print(ary[0]);
		for (int i = 1; i < n; i++) {
			System.out.print(" " + ary[i]);
		}
		System.out.println();
	}
} Main
import java.util.Scanner;
public class Main {
	int n,cnt;
	int[] ary;
	public static void main(String args[]) {
		new Main().run();
	}
	public void run() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		cnt = 0;
		ary = new int[n];
		for (int i = 0; i < n; i++) {
			ary[i] = scan.nextInt();
		}
		for (int i = 0; i < n; i++) {
			int minj = i;
			for (int j = i; j < n; j++) {
				if (ary[minj] > ary[j])
					minj = j;
			}
			if (i != minj) {
				int tmp = ary[i];
				ary[i] = ary[minj];
				ary[minj] = tmp;
				cnt++;
			}
		}
		writeArray();
		System.out.println(cnt);
	}
	public void writeArray() {
		System.out.print(ary[0]);
		for (int i = 1; i < n; i++) {
			System.out.print(" " + ary[i]);
		}
		System.out.println();
	}
}

