import java.util.Scanner;

public class Main {

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

	public static void main(String [] args) {
			
		Scanner in = new Scanner(System.in);
		int numSwaps = 0;
			
		int n = in.nextInt();
		int [] arr = new int [n];
		
			
		for(int i = 0; i < n; i++) {
				arr[i] = in.nextInt();
			}
		
		
			
		for(int j = 0; j < n; j++) {
			
			int minIndex = j;
			
			for(int h = j + 1; h < n; h++) {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			}
			
			if(j != minIndex) {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			}
		}
		for(int k = 0; k < n; k++) {
			System.out.print(arr[k]);
			
			if(k != n - 1) {
				System.out.print(" ");
			}
		}
		System.out.println("\n" + numSwaps);
	}
} Main public static void main(String [] args) {
			
		Scanner in = new Scanner(System.in);
		int numSwaps = 0;
			
		int n = in.nextInt();
		int [] arr = new int [n];
		
			
		for(int i = 0; i < n; i++) {
				arr[i] = in.nextInt();
			}
		
		
			
		for(int j = 0; j < n; j++) {
			
			int minIndex = j;
			
			for(int h = j + 1; h < n; h++) {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			}
			
			if(j != minIndex) {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			}
		}
		for(int k = 0; k < n; k++) {
			System.out.print(arr[k]);
			
			if(k != n - 1) {
				System.out.print(" ");
			}
		}
		System.out.println("\n" + numSwaps);
	} main {
			
		Scanner in = new Scanner(System.in);
		int numSwaps = 0;
			
		int n = in.nextInt();
		int [] arr = new int [n];
		
			
		for(int i = 0; i < n; i++) {
				arr[i] = in.nextInt();
			}
		
		
			
		for(int j = 0; j < n; j++) {
			
			int minIndex = j;
			
			for(int h = j + 1; h < n; h++) {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			}
			
			if(j != minIndex) {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			}
		}
		for(int k = 0; k < n; k++) {
			System.out.print(arr[k]);
			
			if(k != n - 1) {
				System.out.print(" ");
			}
		}
		System.out.println("\n" + numSwaps);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int numSwaps = 0; numSwaps 0 int n = in.nextInt(); n in.nextInt() in.nextInt in int [] arr = new int [n]; arr new int [n] n for(int i = 0; i < n; i++) {
				arr[i] = in.nextInt();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				arr[i] = in.nextInt();
			} {
				arr[i] = in.nextInt();
			} arr[i] = in.nextInt() arr[i] arr i in.nextInt() in.nextInt in for(int j = 0; j < n; j++) {
			
			int minIndex = j;
			
			for(int h = j + 1; h < n; h++) {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			}
			
			if(j != minIndex) {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			}
		} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
			
			int minIndex = j;
			
			for(int h = j + 1; h < n; h++) {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			}
			
			if(j != minIndex) {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			}
		} {
			
			int minIndex = j;
			
			for(int h = j + 1; h < n; h++) {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			}
			
			if(j != minIndex) {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			}
		} int minIndex = j; minIndex j for(int h = j + 1; h < n; h++) {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			} int h = j + 1; int h = j + 1; h j + 1 j 1 h < n h n h++ h++ h {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			} {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			} if(arr[h] <arr[minIndex]) {
					minIndex = h;
				} arr[h] <arr[minIndex] arr[h] arr h arr[minIndex] arr minIndex {
					minIndex = h;
				} minIndex = h minIndex h if(j != minIndex) {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			} j != minIndex j minIndex {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			} int temp = arr[j]; temp arr[j] arr j arr[j] = arr[minIndex] arr[j] arr j arr[minIndex] arr minIndex arr[minIndex] = temp arr[minIndex] arr minIndex temp numSwaps++ numSwaps for(int k = 0; k < n; k++) {
			System.out.print(arr[k]);
			
			if(k != n - 1) {
				System.out.print(" ");
			}
		} int k = 0; int k = 0; k 0 k < n k n k++ k++ k {
			System.out.print(arr[k]);
			
			if(k != n - 1) {
				System.out.print(" ");
			}
		} {
			System.out.print(arr[k]);
			
			if(k != n - 1) {
				System.out.print(" ");
			}
		} System.out.print(arr[k]) System.out.print System.out System System.out arr[k] arr k if(k != n - 1) {
				System.out.print(" ");
			} k != n - 1 k n - 1 n 1 {
				System.out.print(" ");
			} System.out.print(" ") System.out.print System.out System System.out " " System.out.println("\n" + numSwaps) System.out.println System.out System System.out "\n" + numSwaps "\n" numSwaps String [] args args public class Main {

	public static void main(String [] args) {
			
		Scanner in = new Scanner(System.in);
		int numSwaps = 0;
			
		int n = in.nextInt();
		int [] arr = new int [n];
		
			
		for(int i = 0; i < n; i++) {
				arr[i] = in.nextInt();
			}
		
		
			
		for(int j = 0; j < n; j++) {
			
			int minIndex = j;
			
			for(int h = j + 1; h < n; h++) {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			}
			
			if(j != minIndex) {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			}
		}
		for(int k = 0; k < n; k++) {
			System.out.print(arr[k]);
			
			if(k != n - 1) {
				System.out.print(" ");
			}
		}
		System.out.println("\n" + numSwaps);
	}
} public class Main {

	public static void main(String [] args) {
			
		Scanner in = new Scanner(System.in);
		int numSwaps = 0;
			
		int n = in.nextInt();
		int [] arr = new int [n];
		
			
		for(int i = 0; i < n; i++) {
				arr[i] = in.nextInt();
			}
		
		
			
		for(int j = 0; j < n; j++) {
			
			int minIndex = j;
			
			for(int h = j + 1; h < n; h++) {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			}
			
			if(j != minIndex) {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			}
		}
		for(int k = 0; k < n; k++) {
			System.out.print(arr[k]);
			
			if(k != n - 1) {
				System.out.print(" ");
			}
		}
		System.out.println("\n" + numSwaps);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String [] args) {
			
		Scanner in = new Scanner(System.in);
		int numSwaps = 0;
			
		int n = in.nextInt();
		int [] arr = new int [n];
		
			
		for(int i = 0; i < n; i++) {
				arr[i] = in.nextInt();
			}
		
		
			
		for(int j = 0; j < n; j++) {
			
			int minIndex = j;
			
			for(int h = j + 1; h < n; h++) {
				if(arr[h] <arr[minIndex]) {
					minIndex = h;
				}
			}
			
			if(j != minIndex) {
				int temp = arr[j];
				arr[j] = arr[minIndex];
				arr[minIndex] = temp;
				numSwaps++;
			}
		}
		for(int k = 0; k < n; k++) {
			System.out.print(arr[k]);
			
			if(k != n - 1) {
				System.out.print(" ");
			}
		}
		System.out.println("\n" + numSwaps);
	}
}

