import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int []A = new int[N];
		int i, j, k, t, min;
		int l = 0, count = 0;
		
		for(i = 0;i < N; i++) {
			A[i] = sc.nextInt();
		}
		
		for(j = 0;j < A.length; j++) {
			min = A[j];
			for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			}
			if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			}
		}
		
		for (l = 0;l < N - 1; l++) {
			System.out.print(A[l] + " ");
		}
		System.out.println(A[N-1]);
		System.out.println(count);
		
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int []A = new int[N];
		int i, j, k, t, min;
		int l = 0, count = 0;
		
		for(i = 0;i < N; i++) {
			A[i] = sc.nextInt();
		}
		
		for(j = 0;j < A.length; j++) {
			min = A[j];
			for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			}
			if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			}
		}
		
		for (l = 0;l < N - 1; l++) {
			System.out.print(A[l] + " ");
		}
		System.out.println(A[N-1]);
		System.out.println(count);
		
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int []A = new int[N];
		int i, j, k, t, min;
		int l = 0, count = 0;
		
		for(i = 0;i < N; i++) {
			A[i] = sc.nextInt();
		}
		
		for(j = 0;j < A.length; j++) {
			min = A[j];
			for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			}
			if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			}
		}
		
		for (l = 0;l < N - 1; l++) {
			System.out.print(A[l] + " ");
		}
		System.out.println(A[N-1]);
		System.out.println(count);
		
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int []A = new int[N];
		int i, j, k, t, min;
		int l = 0, count = 0;
		
		for(i = 0;i < N; i++) {
			A[i] = sc.nextInt();
		}
		
		for(j = 0;j < A.length; j++) {
			min = A[j];
			for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			}
			if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			}
		}
		
		for (l = 0;l < N - 1; l++) {
			System.out.print(A[l] + " ");
		}
		System.out.println(A[N-1]);
		System.out.println(count);
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int []A = new int[N]; A new int[N] N int i i j j k k t t min; min int l = 0 l 0 count = 0; count 0 for(i = 0;i < N; i++) {
			A[i] = sc.nextInt();
		} i = 0; i = 0 i 0 i < N i N i++ i++ i {
			A[i] = sc.nextInt();
		} {
			A[i] = sc.nextInt();
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc for(j = 0;j < A.length; j++) {
			min = A[j];
			for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			}
			if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			}
		} j = 0; j = 0 j 0 j < A.length j A.length A A.length j++ j++ j {
			min = A[j];
			for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			}
			if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			}
		} {
			min = A[j];
			for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			}
			if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			}
		} min = A[j] min A[j] A j for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			} k = j; k = j k j k < A.length-1 k A.length-1 A.length A A.length 1 k++ k++ k {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			} {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			} if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				} min > A[k+1] min A[k+1] A k+1 k 1 {
					min = A[k+1];
					l = k+1;
				} min = A[k+1] min A[k+1] A k+1 k 1 l = k+1 l k+1 k 1 if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			} A[j] != min A[j] A j min {
				A[l] = A[j];
				A[j] = min;
				count++;
			} A[l] = A[j] A[l] A l A[j] A j A[j] = min A[j] A j min count++ count for (l = 0;l < N - 1; l++) {
			System.out.print(A[l] + " ");
		} l = 0; l = 0 l 0 l < N - 1 l N - 1 N 1 l++ l++ l {
			System.out.print(A[l] + " ");
		} {
			System.out.print(A[l] + " ");
		} System.out.print(A[l] + " ") System.out.print System.out System System.out A[l] + " " A[l] A l " " System.out.println(A[N-1]) System.out.println System.out System System.out A[N-1] A N-1 N 1 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int []A = new int[N];
		int i, j, k, t, min;
		int l = 0, count = 0;
		
		for(i = 0;i < N; i++) {
			A[i] = sc.nextInt();
		}
		
		for(j = 0;j < A.length; j++) {
			min = A[j];
			for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			}
			if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			}
		}
		
		for (l = 0;l < N - 1; l++) {
			System.out.print(A[l] + " ");
		}
		System.out.println(A[N-1]);
		System.out.println(count);
		
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int []A = new int[N];
		int i, j, k, t, min;
		int l = 0, count = 0;
		
		for(i = 0;i < N; i++) {
			A[i] = sc.nextInt();
		}
		
		for(j = 0;j < A.length; j++) {
			min = A[j];
			for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			}
			if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			}
		}
		
		for (l = 0;l < N - 1; l++) {
			System.out.print(A[l] + " ");
		}
		System.out.println(A[N-1]);
		System.out.println(count);
		
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int []A = new int[N];
		int i, j, k, t, min;
		int l = 0, count = 0;
		
		for(i = 0;i < N; i++) {
			A[i] = sc.nextInt();
		}
		
		for(j = 0;j < A.length; j++) {
			min = A[j];
			for(k = j; k < A.length-1; k++) {
				if(min > A[k+1]) {
					min = A[k+1];
					l = k+1;
				}
			}
			if(A[j] != min) {
				A[l] = A[j];
				A[j] = min;
				count++;
			}
		}
		
		for (l = 0;l < N - 1; l++) {
			System.out.print(A[l] + " ");
		}
		System.out.println(A[N-1]);
		System.out.println(count);
		
	}
}
