import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn=new Scanner(System.in);
		int a[]=new int[100],n=stdIn.nextInt(),i,j,m,t,s=0;
		for(i=0;i<n;i++)a[i]=stdIn.nextInt();
		for(i=0;i<n;i++){
			m=i;
			for(j=i;j<n;j++)if(a[m]>a[j])m=j;
			if(a[i]!=a[m])s++;
			t=a[i];
			a[i]=a[m];
			a[m]=t;
		}
		for(i=0;i<n-1;i++)System.out.print(a[i]+" ");
		System.out.println(a[n-1]+"\n"+s);
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args){
		Scanner stdIn=new Scanner(System.in);
		int a[]=new int[100],n=stdIn.nextInt(),i,j,m,t,s=0;
		for(i=0;i<n;i++)a[i]=stdIn.nextInt();
		for(i=0;i<n;i++){
			m=i;
			for(j=i;j<n;j++)if(a[m]>a[j])m=j;
			if(a[i]!=a[m])s++;
			t=a[i];
			a[i]=a[m];
			a[m]=t;
		}
		for(i=0;i<n-1;i++)System.out.print(a[i]+" ");
		System.out.println(a[n-1]+"\n"+s);
	}
} Main public static void main(String[] args){
		Scanner stdIn=new Scanner(System.in);
		int a[]=new int[100],n=stdIn.nextInt(),i,j,m,t,s=0;
		for(i=0;i<n;i++)a[i]=stdIn.nextInt();
		for(i=0;i<n;i++){
			m=i;
			for(j=i;j<n;j++)if(a[m]>a[j])m=j;
			if(a[i]!=a[m])s++;
			t=a[i];
			a[i]=a[m];
			a[m]=t;
		}
		for(i=0;i<n-1;i++)System.out.print(a[i]+" ");
		System.out.println(a[n-1]+"\n"+s);
	} main {
		Scanner stdIn=new Scanner(System.in);
		int a[]=new int[100],n=stdIn.nextInt(),i,j,m,t,s=0;
		for(i=0;i<n;i++)a[i]=stdIn.nextInt();
		for(i=0;i<n;i++){
			m=i;
			for(j=i;j<n;j++)if(a[m]>a[j])m=j;
			if(a[i]!=a[m])s++;
			t=a[i];
			a[i]=a[m];
			a[m]=t;
		}
		for(i=0;i<n-1;i++)System.out.print(a[i]+" ");
		System.out.println(a[n-1]+"\n"+s);
	} Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) int a[]=new int[100] a new int[100] 100 n=stdIn.nextInt() n stdIn.nextInt() stdIn.nextInt stdIn i i j j m m t t s=0; s 0 for(i=0;i<n;i++)a[i]=stdIn.nextInt(); i=0; i=0 i 0 i<n i n i++ i++ i a[i]=stdIn.nextInt(); a[i]=stdIn.nextInt() a[i] a i stdIn.nextInt() stdIn.nextInt stdIn for(i=0;i<n;i++){
			m=i;
			for(j=i;j<n;j++)if(a[m]>a[j])m=j;
			if(a[i]!=a[m])s++;
			t=a[i];
			a[i]=a[m];
			a[m]=t;
		} i=0; i=0 i 0 i<n i n i++ i++ i {
			m=i;
			for(j=i;j<n;j++)if(a[m]>a[j])m=j;
			if(a[i]!=a[m])s++;
			t=a[i];
			a[i]=a[m];
			a[m]=t;
		} {
			m=i;
			for(j=i;j<n;j++)if(a[m]>a[j])m=j;
			if(a[i]!=a[m])s++;
			t=a[i];
			a[i]=a[m];
			a[m]=t;
		} m=i m i for(j=i;j<n;j++)if(a[m]>a[j])m=j; j=i; j=i j i j<n j n j++ j++ j if(a[m]>a[j])m=j; if(a[m]>a[j])m=j; a[m]>a[j] a[m] a m a[j] a j m=j m j if(a[i]!=a[m])s++; a[i]!=a[m] a[i] a i a[m] a m s++ s t=a[i] t a[i] a i a[i]=a[m] a[i] a i a[m] a m a[m]=t a[m] a m t for(i=0;i<n-1;i++)System.out.print(a[i]+" "); i=0; i=0 i 0 i<n-1 i n-1 n 1 i++ i++ i System.out.print(a[i]+" "); System.out.print(a[i]+" ") System.out.print System.out System System.out a[i]+" " a[i] a i " " System.out.println(a[n-1]+"\n"+s) System.out.println System.out System System.out a[n-1]+"\n"+s a[n-1]+"\n"+s a[n-1] a n-1 n 1 "\n" s String[] args args
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn=new Scanner(System.in);
		int a[]=new int[100],n=stdIn.nextInt(),i,j,m,t,s=0;
		for(i=0;i<n;i++)a[i]=stdIn.nextInt();
		for(i=0;i<n;i++){
			m=i;
			for(j=i;j<n;j++)if(a[m]>a[j])m=j;
			if(a[i]!=a[m])s++;
			t=a[i];
			a[i]=a[m];
			a[m]=t;
		}
		for(i=0;i<n-1;i++)System.out.print(a[i]+" ");
		System.out.println(a[n-1]+"\n"+s);
	}
}
