import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		
		int count=0;
		for(int i=0;i<n-1;i++){
			int min=Integer.MAX_VALUE;
			int k=0;
			for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			}
			if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			}
		}
		System.out.print(arr[0]);
		for(int i=1;i<n;i++){
			System.out.print(" "+arr[i]);
		}
		System.out.println();
		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=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		
		int count=0;
		for(int i=0;i<n-1;i++){
			int min=Integer.MAX_VALUE;
			int k=0;
			for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			}
			if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			}
		}
		System.out.print(arr[0]);
		for(int i=1;i<n;i++){
			System.out.print(" "+arr[i]);
		}
		System.out.println();
		System.out.println(count);
	}

} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		
		int count=0;
		for(int i=0;i<n-1;i++){
			int min=Integer.MAX_VALUE;
			int k=0;
			for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			}
			if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			}
		}
		System.out.print(arr[0]);
		for(int i=1;i<n;i++){
			System.out.print(" "+arr[i]);
		}
		System.out.println();
		System.out.println(count);
	} main {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		
		int count=0;
		for(int i=0;i<n-1;i++){
			int min=Integer.MAX_VALUE;
			int k=0;
			for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			}
			if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			}
		}
		System.out.print(arr[0]);
		for(int i=1;i<n;i++){
			System.out.print(" "+arr[i]);
		}
		System.out.println();
		System.out.println(count);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=Integer.valueOf(sc.next()); n Integer.valueOf(sc.next()) Integer.valueOf Integer sc.next() sc.next sc int[] arr= new int[n]; arr new int[n] n for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			arr[i]=Integer.valueOf(sc.next());
		} {
			arr[i]=Integer.valueOf(sc.next());
		} arr[i]=Integer.valueOf(sc.next()) arr[i] arr i Integer.valueOf(sc.next()) Integer.valueOf Integer sc.next() sc.next sc sc.close() sc.close sc int count=0; count 0 for(int i=0;i<n-1;i++){
			int min=Integer.MAX_VALUE;
			int k=0;
			for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			}
			if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			}
		} int i=0; int i=0; i 0 i<n-1 i n-1 n 1 i++ i++ i {
			int min=Integer.MAX_VALUE;
			int k=0;
			for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			}
			if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			}
		} {
			int min=Integer.MAX_VALUE;
			int k=0;
			for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			}
			if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			}
		} int min=Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int k=0; k 0 for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			} int j=i; int j=i; j i j<n j n j++ j++ j {
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			} {
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			} if(min>arr[j]){
					min=arr[j];
					k=j;
				} min>arr[j] min arr[j] arr j {
					min=arr[j];
					k=j;
				} min=arr[j] min arr[j] arr j k=j k j if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			} i!=k i k {
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			} arr[k]=arr[i] arr[k] arr k arr[i] arr i arr[i]=min arr[i] arr i min count++ count System.out.print(arr[0]) System.out.print System.out System System.out arr[0] arr 0 for(int i=1;i<n;i++){
			System.out.print(" "+arr[i]);
		} int i=1; int i=1; i 1 i<n i n i++ i++ i {
			System.out.print(" "+arr[i]);
		} {
			System.out.print(" "+arr[i]);
		} System.out.print(" "+arr[i]) System.out.print System.out System System.out " "+arr[i] " " arr[i] arr i System.out.println() System.out.println System.out System System.out 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=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		
		int count=0;
		for(int i=0;i<n-1;i++){
			int min=Integer.MAX_VALUE;
			int k=0;
			for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			}
			if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			}
		}
		System.out.print(arr[0]);
		for(int i=1;i<n;i++){
			System.out.print(" "+arr[i]);
		}
		System.out.println();
		System.out.println(count);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		
		int count=0;
		for(int i=0;i<n-1;i++){
			int min=Integer.MAX_VALUE;
			int k=0;
			for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			}
			if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			}
		}
		System.out.print(arr[0]);
		for(int i=1;i<n;i++){
			System.out.print(" "+arr[i]);
		}
		System.out.println();
		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=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		
		int count=0;
		for(int i=0;i<n-1;i++){
			int min=Integer.MAX_VALUE;
			int k=0;
			for(int j=i;j<n;j++){
				if(min>arr[j]){
					min=arr[j];
					k=j;
				}
			}
			if(i!=k){
				arr[k]=arr[i];
				arr[i]=min;
				count++;
			}
		}
		System.out.print(arr[0]);
		for(int i=1;i<n;i++){
			System.out.print(" "+arr[i]);
		}
		System.out.println();
		System.out.println(count);
	}

}