import java.io.*;
import java.util.*;

public class Main {

    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));    
    private static StringTokenizer st;

    public static void main ( String [] args ) throws IOException
    {
	new Main().cal();
    }

 
    private void cal() throws IOException 
    {
	int N = Integer.parseInt(br.readLine());
	int [] nums = new int [N];

	st = new StringTokenizer(br.readLine());
	for(int i = 0; i < N; i++) 
	    nums[i] = Integer.parseInt(st.nextToken());

	int count = 0;
	for(int i = 0; i < N; i++) {
	    int mini = i;
	    for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    }
	    if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    }
	}

	for(int i = 0; i < N; i++) {
	    if ( i > 0 ) System.out.print(" ");
	    System.out.print(nums[i]);
	}
	System.out.println("");
	
	System.out.println(count);
	

    }

    private void swap(int [] n, final int i, final int j){
	int temp = n[i];
	n[i] = n[j];
	n[j] = temp;
    }

} import java.io.*; io.* java import java.util.*; util.* java public class Main {

    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));    
    private static StringTokenizer st;

    public static void main ( String [] args ) throws IOException
    {
	new Main().cal();
    }

 
    private void cal() throws IOException 
    {
	int N = Integer.parseInt(br.readLine());
	int [] nums = new int [N];

	st = new StringTokenizer(br.readLine());
	for(int i = 0; i < N; i++) 
	    nums[i] = Integer.parseInt(st.nextToken());

	int count = 0;
	for(int i = 0; i < N; i++) {
	    int mini = i;
	    for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    }
	    if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    }
	}

	for(int i = 0; i < N; i++) {
	    if ( i > 0 ) System.out.print(" ");
	    System.out.print(nums[i]);
	}
	System.out.println("");
	
	System.out.println(count);
	

    }

    private void swap(int [] n, final int i, final int j){
	int temp = n[i];
	n[i] = n[j];
	n[j] = temp;
    }

} Main private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) private static StringTokenizer st; st public static void main ( String [] args ) throws IOException
    {
	new Main().cal();
    } main {
	new Main().cal();
    } new Main().cal() new Main().cal new Main() String [] args args private void cal() throws IOException 
    {
	int N = Integer.parseInt(br.readLine());
	int [] nums = new int [N];

	st = new StringTokenizer(br.readLine());
	for(int i = 0; i < N; i++) 
	    nums[i] = Integer.parseInt(st.nextToken());

	int count = 0;
	for(int i = 0; i < N; i++) {
	    int mini = i;
	    for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    }
	    if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    }
	}

	for(int i = 0; i < N; i++) {
	    if ( i > 0 ) System.out.print(" ");
	    System.out.print(nums[i]);
	}
	System.out.println("");
	
	System.out.println(count);
	

    } cal {
	int N = Integer.parseInt(br.readLine());
	int [] nums = new int [N];

	st = new StringTokenizer(br.readLine());
	for(int i = 0; i < N; i++) 
	    nums[i] = Integer.parseInt(st.nextToken());

	int count = 0;
	for(int i = 0; i < N; i++) {
	    int mini = i;
	    for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    }
	    if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    }
	}

	for(int i = 0; i < N; i++) {
	    if ( i > 0 ) System.out.print(" ");
	    System.out.print(nums[i]);
	}
	System.out.println("");
	
	System.out.println(count);
	

    } int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int [] nums = new int [N]; nums new int [N] N st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) for(int i = 0; i < N; i++) 
	    nums[i] = Integer.parseInt(st.nextToken()); int i = 0; int i = 0; i 0 i < N i N i++ i++ i nums[i] = Integer.parseInt(st.nextToken()); nums[i] = Integer.parseInt(st.nextToken()) nums[i] nums i Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int count = 0; count 0 for(int i = 0; i < N; i++) {
	    int mini = i;
	    for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    }
	    if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    }
	} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
	    int mini = i;
	    for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    }
	    if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    }
	} {
	    int mini = i;
	    for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    }
	    if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    }
	} int mini = i; mini i for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    } int j = i; int j = i; j i j < N j N j++ j++ j {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    } {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    } if ( nums[j] < nums[mini] )
		    mini = j; nums[j] < nums[mini] nums[j] nums j nums[mini] nums mini mini = j mini j if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    } i != mini i mini {
		swap(nums, i, mini);
		count++;
	    } swap(nums, i, mini) swap nums i mini count++ count for(int i = 0; i < N; i++) {
	    if ( i > 0 ) System.out.print(" ");
	    System.out.print(nums[i]);
	} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
	    if ( i > 0 ) System.out.print(" ");
	    System.out.print(nums[i]);
	} {
	    if ( i > 0 ) System.out.print(" ");
	    System.out.print(nums[i]);
	} if ( i > 0 ) System.out.print(" "); i > 0 i 0 System.out.print(" ") System.out.print System.out System System.out " " System.out.print(nums[i]) System.out.print System.out System System.out nums[i] nums i System.out.println("") System.out.println System.out System System.out "" System.out.println(count) System.out.println System.out System System.out count private void swap(int [] n, final int i, final int j){
	int temp = n[i];
	n[i] = n[j];
	n[j] = temp;
    } swap {
	int temp = n[i];
	n[i] = n[j];
	n[j] = temp;
    } int temp = n[i]; temp n[i] n i n[i] = n[j] n[i] n i n[j] n j n[j] = temp n[j] n j temp int [] n n final int i i final int j j public class Main {

    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));    
    private static StringTokenizer st;

    public static void main ( String [] args ) throws IOException
    {
	new Main().cal();
    }

 
    private void cal() throws IOException 
    {
	int N = Integer.parseInt(br.readLine());
	int [] nums = new int [N];

	st = new StringTokenizer(br.readLine());
	for(int i = 0; i < N; i++) 
	    nums[i] = Integer.parseInt(st.nextToken());

	int count = 0;
	for(int i = 0; i < N; i++) {
	    int mini = i;
	    for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    }
	    if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    }
	}

	for(int i = 0; i < N; i++) {
	    if ( i > 0 ) System.out.print(" ");
	    System.out.print(nums[i]);
	}
	System.out.println("");
	
	System.out.println(count);
	

    }

    private void swap(int [] n, final int i, final int j){
	int temp = n[i];
	n[i] = n[j];
	n[j] = temp;
    }

} public class Main {

    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));    
    private static StringTokenizer st;

    public static void main ( String [] args ) throws IOException
    {
	new Main().cal();
    }

 
    private void cal() throws IOException 
    {
	int N = Integer.parseInt(br.readLine());
	int [] nums = new int [N];

	st = new StringTokenizer(br.readLine());
	for(int i = 0; i < N; i++) 
	    nums[i] = Integer.parseInt(st.nextToken());

	int count = 0;
	for(int i = 0; i < N; i++) {
	    int mini = i;
	    for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    }
	    if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    }
	}

	for(int i = 0; i < N; i++) {
	    if ( i > 0 ) System.out.print(" ");
	    System.out.print(nums[i]);
	}
	System.out.println("");
	
	System.out.println(count);
	

    }

    private void swap(int [] n, final int i, final int j){
	int temp = n[i];
	n[i] = n[j];
	n[j] = temp;
    }

} Main
import java.io.*;
import java.util.*;

public class Main {

    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));    
    private static StringTokenizer st;

    public static void main ( String [] args ) throws IOException
    {
	new Main().cal();
    }

 
    private void cal() throws IOException 
    {
	int N = Integer.parseInt(br.readLine());
	int [] nums = new int [N];

	st = new StringTokenizer(br.readLine());
	for(int i = 0; i < N; i++) 
	    nums[i] = Integer.parseInt(st.nextToken());

	int count = 0;
	for(int i = 0; i < N; i++) {
	    int mini = i;
	    for(int j = i; j < N; j++) {
		if ( nums[j] < nums[mini] )
		    mini = j;
	    }
	    if ( i != mini ) {
		swap(nums, i, mini);
		count++;
	    }
	}

	for(int i = 0; i < N; i++) {
	    if ( i > 0 ) System.out.print(" ");
	    System.out.print(nums[i]);
	}
	System.out.println("");
	
	System.out.println(count);
	

    }

    private void swap(int [] n, final int i, final int j){
	int temp = n[i];
	n[i] = n[j];
	n[j] = temp;
    }

}