import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int kazu,i,j,cnt=0,hz,smi;
		Scanner sca = new Scanner(System.in);
		kazu=sca.nextInt();
		int hai[]=new int[kazu];
		for(i=0;i<kazu;i++){
			hai[i]=sca.nextInt();
		}  
		for(i=0;i<kazu;i++){
			smi=i;
			for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				}
			if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			}
		}
	     for(i=0;i<kazu;i++){
	    	    if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     }
	    }
	    	     System.out.println(cnt);

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int kazu,i,j,cnt=0,hz,smi;
		Scanner sca = new Scanner(System.in);
		kazu=sca.nextInt();
		int hai[]=new int[kazu];
		for(i=0;i<kazu;i++){
			hai[i]=sca.nextInt();
		}  
		for(i=0;i<kazu;i++){
			smi=i;
			for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				}
			if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			}
		}
	     for(i=0;i<kazu;i++){
	    	    if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     }
	    }
	    	     System.out.println(cnt);

	}
		
	} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		int kazu,i,j,cnt=0,hz,smi;
		Scanner sca = new Scanner(System.in);
		kazu=sca.nextInt();
		int hai[]=new int[kazu];
		for(i=0;i<kazu;i++){
			hai[i]=sca.nextInt();
		}  
		for(i=0;i<kazu;i++){
			smi=i;
			for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				}
			if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			}
		}
	     for(i=0;i<kazu;i++){
	    	    if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     }
	    }
	    	     System.out.println(cnt);

	} main {
		// TODO Auto-generated method stub
		int kazu,i,j,cnt=0,hz,smi;
		Scanner sca = new Scanner(System.in);
		kazu=sca.nextInt();
		int hai[]=new int[kazu];
		for(i=0;i<kazu;i++){
			hai[i]=sca.nextInt();
		}  
		for(i=0;i<kazu;i++){
			smi=i;
			for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				}
			if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			}
		}
	     for(i=0;i<kazu;i++){
	    	    if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     }
	    }
	    	     System.out.println(cnt);

	} int kazu kazu i i j j cnt=0 cnt 0 hz hz smi; smi Scanner sca = new Scanner(System.in); sca new Scanner(System.in) kazu=sca.nextInt() kazu sca.nextInt() sca.nextInt sca int hai[]=new int[kazu]; hai new int[kazu] kazu for(i=0;i<kazu;i++){
			hai[i]=sca.nextInt();
		} i=0; i=0 i 0 i<kazu i kazu i++ i++ i {
			hai[i]=sca.nextInt();
		} {
			hai[i]=sca.nextInt();
		} hai[i]=sca.nextInt() hai[i] hai i sca.nextInt() sca.nextInt sca for(i=0;i<kazu;i++){
			smi=i;
			for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				}
			if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			}
		} i=0; i=0 i 0 i<kazu i kazu i++ i++ i {
			smi=i;
			for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				}
			if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			}
		} {
			smi=i;
			for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				}
			if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			}
		} smi=i smi i for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				} j=i+1; j=i+1 j i+1 i 1 j<kazu j kazu j++ j++ j {
				if(hai[smi]>hai[j]){
					smi=j;
				}
				} {
				if(hai[smi]>hai[j]){
					smi=j;
				}
				} if(hai[smi]>hai[j]){
					smi=j;
				} hai[smi]>hai[j] hai[smi] hai smi hai[j] hai j {
					smi=j;
				} smi=j smi j if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			} smi!=i smi i {
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			} hz=hai[smi] hz hai[smi] hai smi hai[smi]=hai[i] hai[smi] hai smi hai[i] hai i hai[i]=hz hai[i] hai i hz cnt++ cnt for(i=0;i<kazu;i++){
	    	    if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     }
	    } i=0; i=0 i 0 i<kazu i kazu i++ i++ i {
	    	    if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     }
	    } {
	    	    if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     }
	    } if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     } i!=kazu-1 i kazu-1 kazu 1 {	 
	    	     System.out.print(hai[i]+" ");
	    	     } System.out.print(hai[i]+" ") System.out.print System.out System System.out hai[i]+" " hai[i] hai i " " {
	    	    	 System.out.println(hai[i]);
	    	     } System.out.println(hai[i]) System.out.println System.out System System.out hai[i] hai i System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int kazu,i,j,cnt=0,hz,smi;
		Scanner sca = new Scanner(System.in);
		kazu=sca.nextInt();
		int hai[]=new int[kazu];
		for(i=0;i<kazu;i++){
			hai[i]=sca.nextInt();
		}  
		for(i=0;i<kazu;i++){
			smi=i;
			for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				}
			if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			}
		}
	     for(i=0;i<kazu;i++){
	    	    if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     }
	    }
	    	     System.out.println(cnt);

	}
		
	} public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int kazu,i,j,cnt=0,hz,smi;
		Scanner sca = new Scanner(System.in);
		kazu=sca.nextInt();
		int hai[]=new int[kazu];
		for(i=0;i<kazu;i++){
			hai[i]=sca.nextInt();
		}  
		for(i=0;i<kazu;i++){
			smi=i;
			for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				}
			if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			}
		}
	     for(i=0;i<kazu;i++){
	    	    if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     }
	    }
	    	     System.out.println(cnt);

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int kazu,i,j,cnt=0,hz,smi;
		Scanner sca = new Scanner(System.in);
		kazu=sca.nextInt();
		int hai[]=new int[kazu];
		for(i=0;i<kazu;i++){
			hai[i]=sca.nextInt();
		}  
		for(i=0;i<kazu;i++){
			smi=i;
			for(j=i+1;j<kazu;j++){
				if(hai[smi]>hai[j]){
					smi=j;
				}
				}
			if(smi!=i){
				hz=hai[smi];
				hai[smi]=hai[i];
				hai[i]=hz;
				cnt++;
			}
		}
	     for(i=0;i<kazu;i++){
	    	    if(i!=kazu-1){	 
	    	     System.out.print(hai[i]+" ");
	    	     }else{
	    	    	 System.out.println(hai[i]);
	    	     }
	    }
	    	     System.out.println(cnt);

	}
		
	}
