import java.util.Scanner;
class Main{
    public static void main(String[] args){
	int i,j,n,minj,temp,count=0,change=0;
	int array[] = new int[101];

	Scanner scan = new Scanner(System.in);
	n = scan.nextInt();

	for(i=0;i<n;i++){
	    array[i] = scan.nextInt();
	}

	for(i=0;i<n;i++){
	    minj=i;
	    for(j=i;j<n;j++){
		if(array[j] < array[minj]){
		    minj = j;
		}
	    }
	    if(i!=minj){
	    temp = array[i];
	    array[i] = array[minj];
	    array[minj] = temp;
	    count++;
	    }
	}
	for(i=0;i<n;i++){
	    if(i==n-1){System.out.println(array[i]+"\n"+count);}
	    else System.out.print(array[i]+" ");
	    }
    }
}
 import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
	int i,j,n,minj,temp,count=0,change=0;
	int array[] = new int[101];

	Scanner scan = new Scanner(System.in);
	n = scan.nextInt();

	for(i=0;i<n;i++){
	    array[i] = scan.nextInt();
	}

	for(i=0;i<n;i++){
	    minj=i;
	    for(j=i;j<n;j++){
		if(array[j] < array[minj]){
		    minj = j;
		}
	    }
	    if(i!=minj){
	    temp = array[i];
	    array[i] = array[minj];
	    array[minj] = temp;
	    count++;
	    }
	}
	for(i=0;i<n;i++){
	    if(i==n-1){System.out.println(array[i]+"\n"+count);}
	    else System.out.print(array[i]+" ");
	    }
    }
} Main public static void main(String[] args){
	int i,j,n,minj,temp,count=0,change=0;
	int array[] = new int[101];

	Scanner scan = new Scanner(System.in);
	n = scan.nextInt();

	for(i=0;i<n;i++){
	    array[i] = scan.nextInt();
	}

	for(i=0;i<n;i++){
	    minj=i;
	    for(j=i;j<n;j++){
		if(array[j] < array[minj]){
		    minj = j;
		}
	    }
	    if(i!=minj){
	    temp = array[i];
	    array[i] = array[minj];
	    array[minj] = temp;
	    count++;
	    }
	}
	for(i=0;i<n;i++){
	    if(i==n-1){System.out.println(array[i]+"\n"+count);}
	    else System.out.print(array[i]+" ");
	    }
    } main {
	int i,j,n,minj,temp,count=0,change=0;
	int array[] = new int[101];

	Scanner scan = new Scanner(System.in);
	n = scan.nextInt();

	for(i=0;i<n;i++){
	    array[i] = scan.nextInt();
	}

	for(i=0;i<n;i++){
	    minj=i;
	    for(j=i;j<n;j++){
		if(array[j] < array[minj]){
		    minj = j;
		}
	    }
	    if(i!=minj){
	    temp = array[i];
	    array[i] = array[minj];
	    array[minj] = temp;
	    count++;
	    }
	}
	for(i=0;i<n;i++){
	    if(i==n-1){System.out.println(array[i]+"\n"+count);}
	    else System.out.print(array[i]+" ");
	    }
    } int i i j j n n minj minj temp temp count=0 count 0 change=0; change 0 int array[] = new int[101]; array new int[101] 101 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) n = scan.nextInt() n scan.nextInt() scan.nextInt scan for(i=0;i<n;i++){
	    array[i] = scan.nextInt();
	} i=0; i=0 i 0 i<n i n i++ i++ i {
	    array[i] = scan.nextInt();
	} {
	    array[i] = scan.nextInt();
	} array[i] = scan.nextInt() array[i] array i scan.nextInt() scan.nextInt scan for(i=0;i<n;i++){
	    minj=i;
	    for(j=i;j<n;j++){
		if(array[j] < array[minj]){
		    minj = j;
		}
	    }
	    if(i!=minj){
	    temp = array[i];
	    array[i] = array[minj];
	    array[minj] = temp;
	    count++;
	    }
	} i=0; i=0 i 0 i<n i n i++ i++ i {
	    minj=i;
	    for(j=i;j<n;j++){
		if(array[j] < array[minj]){
		    minj = j;
		}
	    }
	    if(i!=minj){
	    temp = array[i];
	    array[i] = array[minj];
	    array[minj] = temp;
	    count++;
	    }
	} {
	    minj=i;
	    for(j=i;j<n;j++){
		if(array[j] < array[minj]){
		    minj = j;
		}
	    }
	    if(i!=minj){
	    temp = array[i];
	    array[i] = array[minj];
	    array[minj] = temp;
	    count++;
	    }
	} minj=i minj i for(j=i;j<n;j++){
		if(array[j] < array[minj]){
		    minj = j;
		}
	    } j=i; j=i j i j<n j n j++ j++ j {
		if(array[j] < array[minj]){
		    minj = j;
		}
	    } {
		if(array[j] < array[minj]){
		    minj = j;
		}
	    } if(array[j] < array[minj]){
		    minj = j;
		} array[j] < array[minj] array[j] array j array[minj] array minj {
		    minj = j;
		} minj = j minj j if(i!=minj){
	    temp = array[i];
	    array[i] = array[minj];
	    array[minj] = temp;
	    count++;
	    } i!=minj i minj {
	    temp = array[i];
	    array[i] = array[minj];
	    array[minj] = temp;
	    count++;
	    } temp = array[i] temp array[i] array i array[i] = array[minj] array[i] array i array[minj] array minj array[minj] = temp array[minj] array minj temp count++ count for(i=0;i<n;i++){
	    if(i==n-1){System.out.println(array[i]+"\n"+count);}
	    else System.out.print(array[i]+" ");
	    } i=0; i=0 i 0 i<n i n i++ i++ i {
	    if(i==n-1){System.out.println(array[i]+"\n"+count);}
	    else System.out.print(array[i]+" ");
	    } {
	    if(i==n-1){System.out.println(array[i]+"\n"+count);}
	    else System.out.print(array[i]+" ");
	    } if(i==n-1){System.out.println(array[i]+"\n"+count);}
	    else System.out.print(array[i]+" "); i==n-1 i n-1 n 1 {System.out.println(array[i]+"\n"+count);} System.out.println(array[i]+"\n"+count) System.out.println System.out System System.out array[i]+"\n"+count array[i]+"\n"+count array[i] array i "\n" count System.out.print(array[i]+" ") System.out.print System.out System System.out array[i]+" " array[i] array i " " String[] args args
import java.util.Scanner;
class Main{
    public static void main(String[] args){
	int i,j,n,minj,temp,count=0,change=0;
	int array[] = new int[101];

	Scanner scan = new Scanner(System.in);
	n = scan.nextInt();

	for(i=0;i<n;i++){
	    array[i] = scan.nextInt();
	}

	for(i=0;i<n;i++){
	    minj=i;
	    for(j=i;j<n;j++){
		if(array[j] < array[minj]){
		    minj = j;
		}
	    }
	    if(i!=minj){
	    temp = array[i];
	    array[i] = array[minj];
	    array[minj] = temp;
	    count++;
	    }
	}
	for(i=0;i<n;i++){
	    if(i==n-1){System.out.println(array[i]+"\n"+count);}
	    else System.out.print(array[i]+" ");
	    }
    }
}

