import java.io.*;

public class Main{
	public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str =  br.readLine().split(" ") ;
			int[] ar = new int[n];
			for(int i= 0; i<n; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			araiSort(ar,ar.length);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void araiSort(int[] a ,int len)
	{
		int min,temp,cou=0;
		for(int i = 0; i < len-1; i++)
		{
			min = i ;
			for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			}
			if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			}
		}
		show(a,cou);
		
		
	}
	public static void show(int[] b,int co)
	{
		StringBuilder sb = new StringBuilder();
		for(int i = 0 ; i < b.length ; i++ ){
			sb.append(b[i]).append(" ");
		}
		sb.deleteCharAt(sb.length()-1);
		sb.append("\n").append(co);
		System.out.println(sb.toString());
	}
} import java.io.*; io.* java public class Main{
	public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str =  br.readLine().split(" ") ;
			int[] ar = new int[n];
			for(int i= 0; i<n; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			araiSort(ar,ar.length);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void araiSort(int[] a ,int len)
	{
		int min,temp,cou=0;
		for(int i = 0; i < len-1; i++)
		{
			min = i ;
			for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			}
			if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			}
		}
		show(a,cou);
		
		
	}
	public static void show(int[] b,int co)
	{
		StringBuilder sb = new StringBuilder();
		for(int i = 0 ; i < b.length ; i++ ){
			sb.append(b[i]).append(" ");
		}
		sb.deleteCharAt(sb.length()-1);
		sb.append("\n").append(co);
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str =  br.readLine().split(" ") ;
			int[] ar = new int[n];
			for(int i= 0; i<n; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			araiSort(ar,ar.length);
		}catch(Exception e){
			e.printStackTrace();
		}
	} main {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str =  br.readLine().split(" ") ;
			int[] ar = new int[n];
			for(int i= 0; i<n; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			araiSort(ar,ar.length);
		}catch(Exception e){
			e.printStackTrace();
		}
	} try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str =  br.readLine().split(" ") ;
			int[] ar = new int[n];
			for(int i= 0; i<n; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			araiSort(ar,ar.length);
		}catch(Exception e){
			e.printStackTrace();
		} catch(Exception e){
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str =  br.readLine().split(" ") ;
			int[] ar = new int[n];
			for(int i= 0; i<n; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			araiSort(ar,ar.length);
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] str =  br.readLine().split(" ") ; str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] ar = new int[n]; ar new int[n] n for(int i= 0; i<n; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			} int i= 0; int i= 0; i 0 i<n i n i++ i++ i {
				ar[i] = Integer.parseInt(str[i]);
			} {
				ar[i] = Integer.parseInt(str[i]);
			} ar[i] = Integer.parseInt(str[i]) ar[i] ar i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i araiSort(ar,ar.length) araiSort ar ar.length ar ar.length String[] args args public static void araiSort(int[] a ,int len)
	{
		int min,temp,cou=0;
		for(int i = 0; i < len-1; i++)
		{
			min = i ;
			for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			}
			if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			}
		}
		show(a,cou);
		
		
	} araiSort {
		int min,temp,cou=0;
		for(int i = 0; i < len-1; i++)
		{
			min = i ;
			for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			}
			if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			}
		}
		show(a,cou);
		
		
	} int min min temp temp cou=0; cou 0 for(int i = 0; i < len-1; i++)
		{
			min = i ;
			for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			}
			if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			}
		} int i = 0; int i = 0; i 0 i < len-1 i len-1 len 1 i++ i++ i {
			min = i ;
			for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			}
			if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			}
		} {
			min = i ;
			for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			}
			if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			}
		} min = i min i for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			} int j = i+1; int j = i+1; j i+1 i 1 j<len j len j++ j++ j {
				if(a[j] < a[min])
				{
					min = j;
				}
			} {
				if(a[j] < a[min])
				{
					min = j;
				}
			} if(a[j] < a[min])
				{
					min = j;
				} a[j] < a[min] a[j] a j a[min] a min {
					min = j;
				} min = j min j if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			} min != i min i {
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			} temp = a[min] temp a[min] a min a[min] = a[i] a[min] a min a[i] a i a[i] = temp a[i] a i temp cou++ cou show(a,cou) show a cou int[] a a int len len public static void show(int[] b,int co)
	{
		StringBuilder sb = new StringBuilder();
		for(int i = 0 ; i < b.length ; i++ ){
			sb.append(b[i]).append(" ");
		}
		sb.deleteCharAt(sb.length()-1);
		sb.append("\n").append(co);
		System.out.println(sb.toString());
	} show {
		StringBuilder sb = new StringBuilder();
		for(int i = 0 ; i < b.length ; i++ ){
			sb.append(b[i]).append(" ");
		}
		sb.deleteCharAt(sb.length()-1);
		sb.append("\n").append(co);
		System.out.println(sb.toString());
	} StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i = 0 ; i < b.length ; i++ ){
			sb.append(b[i]).append(" ");
		} int i = 0 ; int i = 0 ; i 0 i < b.length i b.length b b.length i++ i++ i {
			sb.append(b[i]).append(" ");
		} {
			sb.append(b[i]).append(" ");
		} sb.append(b[i]).append(" ") sb.append(b[i]).append sb.append(b[i]) sb.append sb b[i] b i " " sb.deleteCharAt(sb.length()-1) sb.deleteCharAt sb sb.length()-1 sb.length() sb.length sb 1 sb.append("\n").append(co) sb.append("\n").append sb.append("\n") sb.append sb "\n" co System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb int[] b b int co co public class Main{
	public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str =  br.readLine().split(" ") ;
			int[] ar = new int[n];
			for(int i= 0; i<n; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			araiSort(ar,ar.length);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void araiSort(int[] a ,int len)
	{
		int min,temp,cou=0;
		for(int i = 0; i < len-1; i++)
		{
			min = i ;
			for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			}
			if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			}
		}
		show(a,cou);
		
		
	}
	public static void show(int[] b,int co)
	{
		StringBuilder sb = new StringBuilder();
		for(int i = 0 ; i < b.length ; i++ ){
			sb.append(b[i]).append(" ");
		}
		sb.deleteCharAt(sb.length()-1);
		sb.append("\n").append(co);
		System.out.println(sb.toString());
	}
} public class Main{
	public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str =  br.readLine().split(" ") ;
			int[] ar = new int[n];
			for(int i= 0; i<n; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			araiSort(ar,ar.length);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void araiSort(int[] a ,int len)
	{
		int min,temp,cou=0;
		for(int i = 0; i < len-1; i++)
		{
			min = i ;
			for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			}
			if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			}
		}
		show(a,cou);
		
		
	}
	public static void show(int[] b,int co)
	{
		StringBuilder sb = new StringBuilder();
		for(int i = 0 ; i < b.length ; i++ ){
			sb.append(b[i]).append(" ");
		}
		sb.deleteCharAt(sb.length()-1);
		sb.append("\n").append(co);
		System.out.println(sb.toString());
	}
} Main
import java.io.*;

public class Main{
	public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str =  br.readLine().split(" ") ;
			int[] ar = new int[n];
			for(int i= 0; i<n; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			araiSort(ar,ar.length);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void araiSort(int[] a ,int len)
	{
		int min,temp,cou=0;
		for(int i = 0; i < len-1; i++)
		{
			min = i ;
			for(int j = i+1; j<len ; j++)
			{
				if(a[j] < a[min])
				{
					min = j;
				}
			}
			if(min != i)
			{
				temp = a[min];
				a[min] = a[i];
				a[i] = temp;
				cou++;
			}
		}
		show(a,cou);
		
		
	}
	public static void show(int[] b,int co)
	{
		StringBuilder sb = new StringBuilder();
		for(int i = 0 ; i < b.length ; i++ ){
			sb.append(b[i]).append(" ");
		}
		sb.deleteCharAt(sb.length()-1);
		sb.append("\n").append(co);
		System.out.println(sb.toString());
	}
}