import java.util.Scanner;
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		Integer length = s.nextInt();
		Integer[] seq = new Integer[length];
		for(int i = 0; i < length; i++){
			seq[i] = s.nextInt();
		}
		Integer count = 0;
		
		for(int i = 0; i < length; i++){
			Integer mini = i;
			for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			}
			Integer bkp = seq[i];
			if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			}
		}
		
		for(int i = 0; i < length; i++){
			if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			}
		}
		System.out.println(count);
	}

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

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		Integer length = s.nextInt();
		Integer[] seq = new Integer[length];
		for(int i = 0; i < length; i++){
			seq[i] = s.nextInt();
		}
		Integer count = 0;
		
		for(int i = 0; i < length; i++){
			Integer mini = i;
			for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			}
			Integer bkp = seq[i];
			if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			}
		}
		
		for(int i = 0; i < length; i++){
			if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			}
		}
		System.out.println(count);
	}

} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		Integer length = s.nextInt();
		Integer[] seq = new Integer[length];
		for(int i = 0; i < length; i++){
			seq[i] = s.nextInt();
		}
		Integer count = 0;
		
		for(int i = 0; i < length; i++){
			Integer mini = i;
			for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			}
			Integer bkp = seq[i];
			if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			}
		}
		
		for(int i = 0; i < length; i++){
			if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			}
		}
		System.out.println(count);
	} main {
		Scanner s = new Scanner(System.in);
		Integer length = s.nextInt();
		Integer[] seq = new Integer[length];
		for(int i = 0; i < length; i++){
			seq[i] = s.nextInt();
		}
		Integer count = 0;
		
		for(int i = 0; i < length; i++){
			Integer mini = i;
			for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			}
			Integer bkp = seq[i];
			if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			}
		}
		
		for(int i = 0; i < length; i++){
			if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			}
		}
		System.out.println(count);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) Integer length = s.nextInt(); length s.nextInt() s.nextInt s Integer[] seq = new Integer[length]; seq new Integer[length] length for(int i = 0; i < length; i++){
			seq[i] = s.nextInt();
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			seq[i] = s.nextInt();
		} {
			seq[i] = s.nextInt();
		} seq[i] = s.nextInt() seq[i] seq i s.nextInt() s.nextInt s Integer count = 0; count 0 for(int i = 0; i < length; i++){
			Integer mini = i;
			for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			}
			Integer bkp = seq[i];
			if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			}
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			Integer mini = i;
			for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			}
			Integer bkp = seq[i];
			if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			}
		} {
			Integer mini = i;
			for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			}
			Integer bkp = seq[i];
			if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			}
		} Integer mini = i; mini i for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			} int j = i; int j = i; j i j < length j length j++ j++ j {
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			} {
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			} if(seq[j] < seq[mini]){
					mini = j;	
				} seq[j] < seq[mini] seq[j] seq j seq[mini] seq mini {
					mini = j;	
				} mini = j mini j Integer bkp = seq[i]; bkp seq[i] seq i if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			} seq[i] != seq[mini] seq[i] seq i seq[mini] seq mini {
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			} seq[i] = seq[mini] seq[i] seq i seq[mini] seq mini seq[mini] = bkp seq[mini] seq mini bkp count++ count for(int i = 0; i < length; i++){
			if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			}
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			}
		} {
			if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			}
		} if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			} i == length - 1 i length - 1 length 1 {
				System.out.print(seq[i] + "\n");
			} System.out.print(seq[i] + "\n") System.out.print System.out System System.out seq[i] + "\n" seq[i] seq i "\n" {
				System.out.print(seq[i] + " ");
			} System.out.print(seq[i] + " ") System.out.print System.out System System.out seq[i] + " " seq[i] seq i " " System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		Integer length = s.nextInt();
		Integer[] seq = new Integer[length];
		for(int i = 0; i < length; i++){
			seq[i] = s.nextInt();
		}
		Integer count = 0;
		
		for(int i = 0; i < length; i++){
			Integer mini = i;
			for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			}
			Integer bkp = seq[i];
			if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			}
		}
		
		for(int i = 0; i < length; i++){
			if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			}
		}
		System.out.println(count);
	}

} public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		Integer length = s.nextInt();
		Integer[] seq = new Integer[length];
		for(int i = 0; i < length; i++){
			seq[i] = s.nextInt();
		}
		Integer count = 0;
		
		for(int i = 0; i < length; i++){
			Integer mini = i;
			for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			}
			Integer bkp = seq[i];
			if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			}
		}
		
		for(int i = 0; i < length; i++){
			if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			}
		}
		System.out.println(count);
	}

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

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		Integer length = s.nextInt();
		Integer[] seq = new Integer[length];
		for(int i = 0; i < length; i++){
			seq[i] = s.nextInt();
		}
		Integer count = 0;
		
		for(int i = 0; i < length; i++){
			Integer mini = i;
			for(int j = i; j < length; j++){
				if(seq[j] < seq[mini]){
					mini = j;	
				}
			}
			Integer bkp = seq[i];
			if(seq[i] != seq[mini]){
				seq[i] = seq[mini];
				seq[mini] = bkp;
				count++;
			}
		}
		
		for(int i = 0; i < length; i++){
			if(i == length - 1){
				System.out.print(seq[i] + "\n");
			}
			else{
				System.out.print(seq[i] + " ");
			}
		}
		System.out.println(count);
	}

}