
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
	static int cnt = 0;
	static PrintWriter out =new PrintWriter(System.out);
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	
    	int n = sc.nextInt();
    	int array[] = new int[n];
    	for(int i=0;i<n;i++) {
    		array[i] = sc.nextInt();
    	}
    	slection(array,n);
    	out.print(array[0]);
    	for(int i=1;i<n;i++) {
    		out.print(" "+array[i]);
    	}
    	out.println();
    	out.println(cnt);
    	out.flush();
    }
    
    static void slection(int[] a,int n) {
    	for(int i=0;i<n-1;i++) {
    		int minj = i;
    		for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		}
    		if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		}
    	}
    }
    	
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
	static int cnt = 0;
	static PrintWriter out =new PrintWriter(System.out);
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	
    	int n = sc.nextInt();
    	int array[] = new int[n];
    	for(int i=0;i<n;i++) {
    		array[i] = sc.nextInt();
    	}
    	slection(array,n);
    	out.print(array[0]);
    	for(int i=1;i<n;i++) {
    		out.print(" "+array[i]);
    	}
    	out.println();
    	out.println(cnt);
    	out.flush();
    }
    
    static void slection(int[] a,int n) {
    	for(int i=0;i<n-1;i++) {
    		int minj = i;
    		for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		}
    		if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		}
    	}
    }
    	
} Main static int cnt = 0; cnt 0 static PrintWriter out =new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	
    	int n = sc.nextInt();
    	int array[] = new int[n];
    	for(int i=0;i<n;i++) {
    		array[i] = sc.nextInt();
    	}
    	slection(array,n);
    	out.print(array[0]);
    	for(int i=1;i<n;i++) {
    		out.print(" "+array[i]);
    	}
    	out.println();
    	out.println(cnt);
    	out.flush();
    } main {
    	Scanner sc = new Scanner(System.in);
    	
    	int n = sc.nextInt();
    	int array[] = new int[n];
    	for(int i=0;i<n;i++) {
    		array[i] = sc.nextInt();
    	}
    	slection(array,n);
    	out.print(array[0]);
    	for(int i=1;i<n;i++) {
    		out.print(" "+array[i]);
    	}
    	out.println();
    	out.println(cnt);
    	out.flush();
    } 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 for(int i=0;i<n;i++) {
    		array[i] = sc.nextInt();
    	} int i=0; int i=0; i 0 i<n i n i++ i++ i {
    		array[i] = sc.nextInt();
    	} {
    		array[i] = sc.nextInt();
    	} array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc slection(array,n) slection array n out.print(array[0]) out.print out array[0] array 0 for(int i=1;i<n;i++) {
    		out.print(" "+array[i]);
    	} int i=1; int i=1; i 1 i<n i n i++ i++ i {
    		out.print(" "+array[i]);
    	} {
    		out.print(" "+array[i]);
    	} out.print(" "+array[i]) out.print out " "+array[i] " " array[i] array i out.println() out.println out out.println(cnt) out.println out cnt out.flush() out.flush out String[] args args static void slection(int[] a,int n) {
    	for(int i=0;i<n-1;i++) {
    		int minj = i;
    		for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		}
    		if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		}
    	}
    } slection {
    	for(int i=0;i<n-1;i++) {
    		int minj = i;
    		for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		}
    		if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		}
    	}
    } for(int i=0;i<n-1;i++) {
    		int minj = i;
    		for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		}
    		if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		}
    	} int i=0; int i=0; i 0 i<n-1 i n-1 n 1 i++ i++ i {
    		int minj = i;
    		for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		}
    		if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		}
    	} {
    		int minj = i;
    		for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		}
    		if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		}
    	} int minj = i; minj i for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		} int j=i; int j=i; j i j<n j n j++ j++ j {
    			if(a[j]<a[minj]) 
    				minj = j;
    		} {
    			if(a[j]<a[minj]) 
    				minj = j;
    		} if(a[j]<a[minj]) 
    				minj = j; a[j]<a[minj] a[j] a j a[minj] a minj minj = j minj j if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		} a[minj]!=a[i] a[minj] a minj a[i] a i {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		} cnt++ cnt int tmp = a[minj]; tmp a[minj] a minj a[minj] = a[i] a[minj] a minj a[i] a i a[i] = tmp a[i] a i tmp int[] a a int n n public class Main {
	static int cnt = 0;
	static PrintWriter out =new PrintWriter(System.out);
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	
    	int n = sc.nextInt();
    	int array[] = new int[n];
    	for(int i=0;i<n;i++) {
    		array[i] = sc.nextInt();
    	}
    	slection(array,n);
    	out.print(array[0]);
    	for(int i=1;i<n;i++) {
    		out.print(" "+array[i]);
    	}
    	out.println();
    	out.println(cnt);
    	out.flush();
    }
    
    static void slection(int[] a,int n) {
    	for(int i=0;i<n-1;i++) {
    		int minj = i;
    		for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		}
    		if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		}
    	}
    }
    	
} public class Main {
	static int cnt = 0;
	static PrintWriter out =new PrintWriter(System.out);
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	
    	int n = sc.nextInt();
    	int array[] = new int[n];
    	for(int i=0;i<n;i++) {
    		array[i] = sc.nextInt();
    	}
    	slection(array,n);
    	out.print(array[0]);
    	for(int i=1;i<n;i++) {
    		out.print(" "+array[i]);
    	}
    	out.println();
    	out.println(cnt);
    	out.flush();
    }
    
    static void slection(int[] a,int n) {
    	for(int i=0;i<n-1;i++) {
    		int minj = i;
    		for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		}
    		if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		}
    	}
    }
    	
} Main

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
	static int cnt = 0;
	static PrintWriter out =new PrintWriter(System.out);
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	
    	int n = sc.nextInt();
    	int array[] = new int[n];
    	for(int i=0;i<n;i++) {
    		array[i] = sc.nextInt();
    	}
    	slection(array,n);
    	out.print(array[0]);
    	for(int i=1;i<n;i++) {
    		out.print(" "+array[i]);
    	}
    	out.println();
    	out.println(cnt);
    	out.flush();
    }
    
    static void slection(int[] a,int n) {
    	for(int i=0;i<n-1;i++) {
    		int minj = i;
    		for(int j=i;j<n;j++) {
    			if(a[j]<a[minj]) 
    				minj = j;
    		}
    		if(a[minj]!=a[i]) {
    			cnt++;
    			int tmp = a[minj];
    			a[minj] = a[i];
   				a[i] = tmp;
    		}
    	}
    }
    	
}
