import java.util.Scanner;
public class Main{
	
	private static int N_MAX = 100;
	
	static int[] a = new int[N_MAX];

public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n;
		n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++){
			a[i]= scan.nextInt();
			
		}
		for(int i = 0; i< n; i++){
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		}
		
		for (int k = 0; k < n - 1; k++){
			System.out.printf(a[k] + " ");
		}
		System.out.println(a[n-1]);
		System.out.println(ans);
	
}
}
 import java.util.Scanner; Scanner java.util public class Main{
	
	private static int N_MAX = 100;
	
	static int[] a = new int[N_MAX];

public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n;
		n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++){
			a[i]= scan.nextInt();
			
		}
		for(int i = 0; i< n; i++){
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		}
		
		for (int k = 0; k < n - 1; k++){
			System.out.printf(a[k] + " ");
		}
		System.out.println(a[n-1]);
		System.out.println(ans);
	
}
} Main private static int N_MAX = 100; N_MAX 100 static int[] a = new int[N_MAX]; a new int[N_MAX] N_MAX public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n;
		n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++){
			a[i]= scan.nextInt();
			
		}
		for(int i = 0; i< n; i++){
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		}
		
		for (int k = 0; k < n - 1; k++){
			System.out.printf(a[k] + " ");
		}
		System.out.println(a[n-1]);
		System.out.println(ans);
	
} main {
		
		Scanner scan = new Scanner(System.in);
		int n;
		n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++){
			a[i]= scan.nextInt();
			
		}
		for(int i = 0; i< n; i++){
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		}
		
		for (int k = 0; k < n - 1; k++){
			System.out.printf(a[k] + " ");
		}
		System.out.println(a[n-1]);
		System.out.println(ans);
	
} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n; n n = scan.nextInt() n scan.nextInt() scan.nextInt scan int ans = 0; ans 0 for (int i = 0; i < n; i++){
			a[i]= scan.nextInt();
			
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i]= scan.nextInt();
			
		} {
			a[i]= scan.nextInt();
			
		} a[i]= scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan for(int i = 0; i< n; i++){
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		} int i = 0; int i = 0; i 0 i< n i n i++ i++ i {
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		} {
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		} int mini = i; mini i for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			} int j = i; int j = i; j i j < n j n j++ j++ j {
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			} {
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			} if(a[j] < a[mini]){
					mini = j;
				} else {} a[j] < a[mini] a[j] a j a[mini] a mini {
					mini = j;
				} mini = j mini j {} if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			} i != mini i mini {
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			} ans++ ans int hold = a[i]; hold a[i] a i a[i] = a[mini] a[i] a i a[mini] a mini a[mini] = hold a[mini] a mini hold for (int k = 0; k < n - 1; k++){
			System.out.printf(a[k] + " ");
		} int k = 0; int k = 0; k 0 k < n - 1 k n - 1 n 1 k++ k++ k {
			System.out.printf(a[k] + " ");
		} {
			System.out.printf(a[k] + " ");
		} System.out.printf(a[k] + " ") System.out.printf System.out System System.out a[k] + " " a[k] a k " " 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(ans) System.out.println System.out System System.out ans String[] args args public class Main{
	
	private static int N_MAX = 100;
	
	static int[] a = new int[N_MAX];

public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n;
		n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++){
			a[i]= scan.nextInt();
			
		}
		for(int i = 0; i< n; i++){
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		}
		
		for (int k = 0; k < n - 1; k++){
			System.out.printf(a[k] + " ");
		}
		System.out.println(a[n-1]);
		System.out.println(ans);
	
}
} public class Main{
	
	private static int N_MAX = 100;
	
	static int[] a = new int[N_MAX];

public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n;
		n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++){
			a[i]= scan.nextInt();
			
		}
		for(int i = 0; i< n; i++){
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		}
		
		for (int k = 0; k < n - 1; k++){
			System.out.printf(a[k] + " ");
		}
		System.out.println(a[n-1]);
		System.out.println(ans);
	
}
} Main
import java.util.Scanner;
public class Main{
	
	private static int N_MAX = 100;
	
	static int[] a = new int[N_MAX];

public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int n;
		n = scan.nextInt();
		int ans = 0;
		for (int i = 0; i < n; i++){
			a[i]= scan.nextInt();
			
		}
		for(int i = 0; i< n; i++){
			int mini = i;
			for (int j = i; j < n; j++){
				if(a[j] < a[mini]){
					mini = j;
				} else {}
				
			}
			if (i != mini){
				ans++;
				int hold = a[i];
				a[i] = a[mini];
				a[mini] = hold;
			}
		}
		
		for (int k = 0; k < n - 1; k++){
			System.out.printf(a[k] + " ");
		}
		System.out.println(a[n-1]);
		System.out.println(ans);
	
}
}

