import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int array[] = new int[N];
		int minj, tmp, pointer = 0, count = 0;

		for(int i = 0; i < array.length; i ++){
			array[i] = sc.nextInt();
		}

		for(int i = 0; i < array.length; i ++){
			minj = Integer.MAX_VALUE;
			for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			}
			if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			}
		}
		for(int i = 0; i < array.length; i++){
			if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			}
		}
		System.out.println(count);
		sc.close();
	}

}
 import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int array[] = new int[N];
		int minj, tmp, pointer = 0, count = 0;

		for(int i = 0; i < array.length; i ++){
			array[i] = sc.nextInt();
		}

		for(int i = 0; i < array.length; i ++){
			minj = Integer.MAX_VALUE;
			for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			}
			if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			}
		}
		for(int i = 0; i < array.length; i++){
			if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			}
		}
		System.out.println(count);
		sc.close();
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int array[] = new int[N];
		int minj, tmp, pointer = 0, count = 0;

		for(int i = 0; i < array.length; i ++){
			array[i] = sc.nextInt();
		}

		for(int i = 0; i < array.length; i ++){
			minj = Integer.MAX_VALUE;
			for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			}
			if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			}
		}
		for(int i = 0; i < array.length; i++){
			if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			}
		}
		System.out.println(count);
		sc.close();
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int array[] = new int[N];
		int minj, tmp, pointer = 0, count = 0;

		for(int i = 0; i < array.length; i ++){
			array[i] = sc.nextInt();
		}

		for(int i = 0; i < array.length; i ++){
			minj = Integer.MAX_VALUE;
			for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			}
			if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			}
		}
		for(int i = 0; i < array.length; i++){
			if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			}
		}
		System.out.println(count);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int array[] = new int[N]; array new int[N] N int minj minj tmp tmp pointer = 0 pointer 0 count = 0; count 0 for(int i = 0; i < array.length; i ++){
			array[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i ++ i ++ i {
			array[i] = sc.nextInt();
		} {
			array[i] = sc.nextInt();
		} array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc for(int i = 0; i < array.length; i ++){
			minj = Integer.MAX_VALUE;
			for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			}
			if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			}
		} int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i ++ i ++ i {
			minj = Integer.MAX_VALUE;
			for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			}
			if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			}
		} {
			minj = Integer.MAX_VALUE;
			for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			}
			if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			}
		} minj = Integer.MAX_VALUE minj Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			} int j = i ; int j = i ; j i j < array.length j array.length array array.length j++ j++ j {
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			} {
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			} if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				} i != j i j {
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				} if(array[j] < minj){
					minj = array[j];
					pointer = j;
					} array[j] < minj array[j] array j minj {
					minj = array[j];
					pointer = j;
					} minj = array[j] minj array[j] array j pointer = j pointer j if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			} array[i] > minj array[i] array i minj {
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			} tmp = array[i] tmp array[i] array i array[i] = minj array[i] array i minj array[pointer] = tmp array[pointer] array pointer tmp count++ count for(int i = 0; i < array.length; i++){
			if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			}
		} int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
			if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			}
		} {
			if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			}
		} if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			} i == array.length -1 i array.length -1 array.length array array.length 1 {
				System.out.println(array[i]);
			} System.out.println(array[i]) System.out.println System.out System System.out array[i] array i {
				System.out.print(array[i] + " ");
			} System.out.print(array[i] + " ") System.out.print System.out System System.out array[i] + " " array[i] array i " " System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int array[] = new int[N];
		int minj, tmp, pointer = 0, count = 0;

		for(int i = 0; i < array.length; i ++){
			array[i] = sc.nextInt();
		}

		for(int i = 0; i < array.length; i ++){
			minj = Integer.MAX_VALUE;
			for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			}
			if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			}
		}
		for(int i = 0; i < array.length; i++){
			if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			}
		}
		System.out.println(count);
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int array[] = new int[N];
		int minj, tmp, pointer = 0, count = 0;

		for(int i = 0; i < array.length; i ++){
			array[i] = sc.nextInt();
		}

		for(int i = 0; i < array.length; i ++){
			minj = Integer.MAX_VALUE;
			for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			}
			if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			}
		}
		for(int i = 0; i < array.length; i++){
			if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			}
		}
		System.out.println(count);
		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int array[] = new int[N];
		int minj, tmp, pointer = 0, count = 0;

		for(int i = 0; i < array.length; i ++){
			array[i] = sc.nextInt();
		}

		for(int i = 0; i < array.length; i ++){
			minj = Integer.MAX_VALUE;
			for(int j = i ; j < array.length; j++){
				if(i != j){
					if(array[j] < minj){
					minj = array[j];
					pointer = j;
					}
				}
			}
			if(array[i] > minj){
				tmp = array[i];
				array[i] = minj;
				array[pointer] = tmp;
				count++;
			}
		}
		for(int i = 0; i < array.length; i++){
			if(i == array.length -1){
				System.out.println(array[i]);
			}else{
				System.out.print(array[i] + " ");
			}
		}
		System.out.println(count);
		sc.close();
	}

}

