import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int[] ns = new int[n];
        for(int i=0;i<n;i++) {
        	ns[i] = Integer.valueOf(scan.next());
        }
        int change = 0;
        int minj=0;
        int cnt=0;
        for(int i=0;i<n;i++) {
        	minj = i; 
        	for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	}
        	if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	}
        }
        for(int i=0;i<n-1;i++) {
        	System.out.print(ns[i]+" ");
        }
        System.out.println(ns[n-1]);
        System.out.println(cnt);
        scan.close();
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int[] ns = new int[n];
        for(int i=0;i<n;i++) {
        	ns[i] = Integer.valueOf(scan.next());
        }
        int change = 0;
        int minj=0;
        int cnt=0;
        for(int i=0;i<n;i++) {
        	minj = i; 
        	for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	}
        	if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	}
        }
        for(int i=0;i<n-1;i++) {
        	System.out.print(ns[i]+" ");
        }
        System.out.println(ns[n-1]);
        System.out.println(cnt);
        scan.close();
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int[] ns = new int[n];
        for(int i=0;i<n;i++) {
        	ns[i] = Integer.valueOf(scan.next());
        }
        int change = 0;
        int minj=0;
        int cnt=0;
        for(int i=0;i<n;i++) {
        	minj = i; 
        	for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	}
        	if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	}
        }
        for(int i=0;i<n-1;i++) {
        	System.out.print(ns[i]+" ");
        }
        System.out.println(ns[n-1]);
        System.out.println(cnt);
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int[] ns = new int[n];
        for(int i=0;i<n;i++) {
        	ns[i] = Integer.valueOf(scan.next());
        }
        int change = 0;
        int minj=0;
        int cnt=0;
        for(int i=0;i<n;i++) {
        	minj = i; 
        	for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	}
        	if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	}
        }
        for(int i=0;i<n-1;i++) {
        	System.out.print(ns[i]+" ");
        }
        System.out.println(ns[n-1]);
        System.out.println(cnt);
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = Integer.valueOf(scan.next()); n Integer.valueOf(scan.next()) Integer.valueOf Integer scan.next() scan.next scan int[] ns = new int[n]; ns new int[n] n for(int i=0;i<n;i++) {
        	ns[i] = Integer.valueOf(scan.next());
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	ns[i] = Integer.valueOf(scan.next());
        } {
        	ns[i] = Integer.valueOf(scan.next());
        } ns[i] = Integer.valueOf(scan.next()) ns[i] ns i Integer.valueOf(scan.next()) Integer.valueOf Integer scan.next() scan.next scan int change = 0; change 0 int minj=0; minj 0 int cnt=0; cnt 0 for(int i=0;i<n;i++) {
        	minj = i; 
        	for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	}
        	if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	}
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	minj = i; 
        	for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	}
        	if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	}
        } {
        	minj = i; 
        	for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	}
        	if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	}
        } minj = i minj i for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	} int j=i; int j=i; j i j<n j n j++ j++ j {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	} {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	} if(ns[j]<ns[minj]) {
        			minj = j;
        		} ns[j]<ns[minj] ns[j] ns j ns[minj] ns minj {
        			minj = j;
        		} minj = j minj j if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	} minj!=i minj i {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	} change = ns[minj] change ns[minj] ns minj ns[minj] = ns[i] ns[minj] ns minj ns[i] ns i ns[i] = change ns[i] ns i change cnt++ cnt for(int i=0;i<n-1;i++) {
        	System.out.print(ns[i]+" ");
        } int i=0; int i=0; i 0 i<n-1 i n-1 n 1 i++ i++ i {
        	System.out.print(ns[i]+" ");
        } {
        	System.out.print(ns[i]+" ");
        } System.out.print(ns[i]+" ") System.out.print System.out System System.out ns[i]+" " ns[i] ns i " " System.out.println(ns[n-1]) System.out.println System.out System System.out ns[n-1] ns n-1 n 1 System.out.println(cnt) System.out.println System.out System System.out cnt scan.close() scan.close scan String[] args args public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int[] ns = new int[n];
        for(int i=0;i<n;i++) {
        	ns[i] = Integer.valueOf(scan.next());
        }
        int change = 0;
        int minj=0;
        int cnt=0;
        for(int i=0;i<n;i++) {
        	minj = i; 
        	for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	}
        	if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	}
        }
        for(int i=0;i<n-1;i++) {
        	System.out.print(ns[i]+" ");
        }
        System.out.println(ns[n-1]);
        System.out.println(cnt);
        scan.close();
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int[] ns = new int[n];
        for(int i=0;i<n;i++) {
        	ns[i] = Integer.valueOf(scan.next());
        }
        int change = 0;
        int minj=0;
        int cnt=0;
        for(int i=0;i<n;i++) {
        	minj = i; 
        	for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	}
        	if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	}
        }
        for(int i=0;i<n-1;i++) {
        	System.out.print(ns[i]+" ");
        }
        System.out.println(ns[n-1]);
        System.out.println(cnt);
        scan.close();
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.next());
        int[] ns = new int[n];
        for(int i=0;i<n;i++) {
        	ns[i] = Integer.valueOf(scan.next());
        }
        int change = 0;
        int minj=0;
        int cnt=0;
        for(int i=0;i<n;i++) {
        	minj = i; 
        	for(int j=i;j<n;j++) {
        		if(ns[j]<ns[minj]) {
        			minj = j;
        		}
        	}
        	if(minj!=i) {
	        	change = ns[minj];
	        	ns[minj] = ns[i];
	        	ns[i] = change;
	        	cnt++;
        	}
        }
        for(int i=0;i<n-1;i++) {
        	System.out.print(ns[i]+" ");
        }
        System.out.println(ns[n-1]);
        System.out.println(cnt);
        scan.close();
    }
}
