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());
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz