
import java.util.*;
class Main { 
	public static void main(String...args) {
		Scanner scan = new Scanner(System.in);
		int aryLen = scan.nextInt();
		int[] ary = new int[aryLen];
		int min = 0;
		int count = 0;
		int point = 0;
		for(int i = 0 ; i < aryLen; i++ ) {
			ary[i] = scan.nextInt();
		}

		for(int n = 0; n < aryLen; n++) {
			min = ary[n];
			for(int j = n + 1; j < aryLen; j++) {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			}
			if(min != ary[n]) {
				count++;
				ary[point] = ary[n];
				ary[n] = min;
			}
		}
		for(int k = 0; k < aryLen; k++) {
			System.out.print(ary[k]);
			if(k != aryLen-1 ) {
				System.out.print(" ");
			} else {
				System.out.println();
			}
		}
		System.out.println(count);
	}
} import java.util.*; util.* java class Main { 
	public static void main(String...args) {
		Scanner scan = new Scanner(System.in);
		int aryLen = scan.nextInt();
		int[] ary = new int[aryLen];
		int min = 0;
		int count = 0;
		int point = 0;
		for(int i = 0 ; i < aryLen; i++ ) {
			ary[i] = scan.nextInt();
		}

		for(int n = 0; n < aryLen; n++) {
			min = ary[n];
			for(int j = n + 1; j < aryLen; j++) {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			}
			if(min != ary[n]) {
				count++;
				ary[point] = ary[n];
				ary[n] = min;
			}
		}
		for(int k = 0; k < aryLen; k++) {
			System.out.print(ary[k]);
			if(k != aryLen-1 ) {
				System.out.print(" ");
			} else {
				System.out.println();
			}
		}
		System.out.println(count);
	}
} Main public static void main(String...args) {
		Scanner scan = new Scanner(System.in);
		int aryLen = scan.nextInt();
		int[] ary = new int[aryLen];
		int min = 0;
		int count = 0;
		int point = 0;
		for(int i = 0 ; i < aryLen; i++ ) {
			ary[i] = scan.nextInt();
		}

		for(int n = 0; n < aryLen; n++) {
			min = ary[n];
			for(int j = n + 1; j < aryLen; j++) {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			}
			if(min != ary[n]) {
				count++;
				ary[point] = ary[n];
				ary[n] = min;
			}
		}
		for(int k = 0; k < aryLen; k++) {
			System.out.print(ary[k]);
			if(k != aryLen-1 ) {
				System.out.print(" ");
			} else {
				System.out.println();
			}
		}
		System.out.println(count);
	} main {
		Scanner scan = new Scanner(System.in);
		int aryLen = scan.nextInt();
		int[] ary = new int[aryLen];
		int min = 0;
		int count = 0;
		int point = 0;
		for(int i = 0 ; i < aryLen; i++ ) {
			ary[i] = scan.nextInt();
		}

		for(int n = 0; n < aryLen; n++) {
			min = ary[n];
			for(int j = n + 1; j < aryLen; j++) {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			}
			if(min != ary[n]) {
				count++;
				ary[point] = ary[n];
				ary[n] = min;
			}
		}
		for(int k = 0; k < aryLen; k++) {
			System.out.print(ary[k]);
			if(k != aryLen-1 ) {
				System.out.print(" ");
			} else {
				System.out.println();
			}
		}
		System.out.println(count);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int aryLen = scan.nextInt(); aryLen scan.nextInt() scan.nextInt scan int[] ary = new int[aryLen]; ary new int[aryLen] aryLen int min = 0; min 0 int count = 0; count 0 int point = 0; point 0 for(int i = 0 ; i < aryLen; i++ ) {
			ary[i] = scan.nextInt();
		} int i = 0 ; int i = 0 ; i 0 i < aryLen i aryLen 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 n = 0; n < aryLen; n++) {
			min = ary[n];
			for(int j = n + 1; j < aryLen; j++) {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			}
			if(min != ary[n]) {
				count++;
				ary[point] = ary[n];
				ary[n] = min;
			}
		} int n = 0; int n = 0; n 0 n < aryLen n aryLen n++ n++ n {
			min = ary[n];
			for(int j = n + 1; j < aryLen; j++) {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			}
			if(min != ary[n]) {
				count++;
				ary[point] = ary[n];
				ary[n] = min;
			}
		} {
			min = ary[n];
			for(int j = n + 1; j < aryLen; j++) {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			}
			if(min != ary[n]) {
				count++;
				ary[point] = ary[n];
				ary[n] = min;
			}
		} min = ary[n] min ary[n] ary n for(int j = n + 1; j < aryLen; j++) {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			} int j = n + 1; int j = n + 1; j n + 1 n 1 j < aryLen j aryLen j++ j++ j {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			} {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			} if(ary[j] < min) {
					min = ary[j];
					point = j;
				} ary[j] < min ary[j] ary j min {
					min = ary[j];
					point = j;
				} min = ary[j] min ary[j] ary j point = j point j if(min != ary[n]) {
				count++;
				ary[point] = ary[n];
				ary[n] = min;
			} min != ary[n] min ary[n] ary n {
				count++;
				ary[point] = ary[n];
				ary[n] = min;
			} count++ count ary[point] = ary[n] ary[point] ary point ary[n] ary n ary[n] = min ary[n] ary n min for(int k = 0; k < aryLen; k++) {
			System.out.print(ary[k]);
			if(k != aryLen-1 ) {
				System.out.print(" ");
			} else {
				System.out.println();
			}
		} int k = 0; int k = 0; k 0 k < aryLen k aryLen k++ k++ k {
			System.out.print(ary[k]);
			if(k != aryLen-1 ) {
				System.out.print(" ");
			} else {
				System.out.println();
			}
		} {
			System.out.print(ary[k]);
			if(k != aryLen-1 ) {
				System.out.print(" ");
			} else {
				System.out.println();
			}
		} System.out.print(ary[k]) System.out.print System.out System System.out ary[k] ary k if(k != aryLen-1 ) {
				System.out.print(" ");
			} else {
				System.out.println();
			} k != aryLen-1 k aryLen-1 aryLen 1 {
				System.out.print(" ");
			} System.out.print(" ") System.out.print System.out System System.out " " {
				System.out.println();
			} System.out.println() System.out.println System.out System System.out System.out.println(count) System.out.println System.out System System.out count String...args args

import java.util.*;
class Main { 
	public static void main(String...args) {
		Scanner scan = new Scanner(System.in);
		int aryLen = scan.nextInt();
		int[] ary = new int[aryLen];
		int min = 0;
		int count = 0;
		int point = 0;
		for(int i = 0 ; i < aryLen; i++ ) {
			ary[i] = scan.nextInt();
		}

		for(int n = 0; n < aryLen; n++) {
			min = ary[n];
			for(int j = n + 1; j < aryLen; j++) {
				if(ary[j] < min) {
					min = ary[j];
					point = j;
				}
			}
			if(min != ary[n]) {
				count++;
				ary[point] = ary[n];
				ary[n] = min;
			}
		}
		for(int k = 0; k < aryLen; k++) {
			System.out.print(ary[k]);
			if(k != aryLen-1 ) {
				System.out.print(" ");
			} else {
				System.out.println();
			}
		}
		System.out.println(count);
	}
}
