import java.util.Scanner;

class Main{
    public static void main(String[] args){
	int i;
	int j;
	int minj;
	int v;
	int count = 0;
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int A[] = new int[n];

	//Initialize data
        for(i=0 ; i<n ; i++){
            int num = scan.nextInt();
            A[i] = num;
        }
	
	for(i=0 ; i<n ; i++){
	    minj = i;
	    
	    for(j=i ; j<n ; j++){
		if(A[j] < A[minj]){
		    minj = j;
			}
	    }
	    if(A[i] != A[minj]){
	    	v = A[i];
	    	A[i] = A[minj];
	   		A[minj] = v;
	    	count++;
		}	
	}

	for(i=0 ; i<n-1 ; i++){
	    System.out.print(A[i] + " ");
	}
	System.out.println(A[i]);
	System.out.println(count);
	
    }
}
 import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
	int i;
	int j;
	int minj;
	int v;
	int count = 0;
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int A[] = new int[n];

	//Initialize data
        for(i=0 ; i<n ; i++){
            int num = scan.nextInt();
            A[i] = num;
        }
	
	for(i=0 ; i<n ; i++){
	    minj = i;
	    
	    for(j=i ; j<n ; j++){
		if(A[j] < A[minj]){
		    minj = j;
			}
	    }
	    if(A[i] != A[minj]){
	    	v = A[i];
	    	A[i] = A[minj];
	   		A[minj] = v;
	    	count++;
		}	
	}

	for(i=0 ; i<n-1 ; i++){
	    System.out.print(A[i] + " ");
	}
	System.out.println(A[i]);
	System.out.println(count);
	
    }
} Main public static void main(String[] args){
	int i;
	int j;
	int minj;
	int v;
	int count = 0;
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int A[] = new int[n];

	//Initialize data
        for(i=0 ; i<n ; i++){
            int num = scan.nextInt();
            A[i] = num;
        }
	
	for(i=0 ; i<n ; i++){
	    minj = i;
	    
	    for(j=i ; j<n ; j++){
		if(A[j] < A[minj]){
		    minj = j;
			}
	    }
	    if(A[i] != A[minj]){
	    	v = A[i];
	    	A[i] = A[minj];
	   		A[minj] = v;
	    	count++;
		}	
	}

	for(i=0 ; i<n-1 ; i++){
	    System.out.print(A[i] + " ");
	}
	System.out.println(A[i]);
	System.out.println(count);
	
    } main {
	int i;
	int j;
	int minj;
	int v;
	int count = 0;
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int A[] = new int[n];

	//Initialize data
        for(i=0 ; i<n ; i++){
            int num = scan.nextInt();
            A[i] = num;
        }
	
	for(i=0 ; i<n ; i++){
	    minj = i;
	    
	    for(j=i ; j<n ; j++){
		if(A[j] < A[minj]){
		    minj = j;
			}
	    }
	    if(A[i] != A[minj]){
	    	v = A[i];
	    	A[i] = A[minj];
	   		A[minj] = v;
	    	count++;
		}	
	}

	for(i=0 ; i<n-1 ; i++){
	    System.out.print(A[i] + " ");
	}
	System.out.println(A[i]);
	System.out.println(count);
	
    } int i; i int j; j int minj; minj int v; v int count = 0; count 0 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int A[] = new int[n]; A new int[n] n for(i=0 ; i<n ; i++){
            int num = scan.nextInt();
            A[i] = num;
        } i=0 ; i=0 i 0 i<n i n i++ i++ i {
            int num = scan.nextInt();
            A[i] = num;
        } {
            int num = scan.nextInt();
            A[i] = num;
        } int num = scan.nextInt(); num scan.nextInt() scan.nextInt scan A[i] = num A[i] A i num for(i=0 ; i<n ; i++){
	    minj = i;
	    
	    for(j=i ; j<n ; j++){
		if(A[j] < A[minj]){
		    minj = j;
			}
	    }
	    if(A[i] != A[minj]){
	    	v = A[i];
	    	A[i] = A[minj];
	   		A[minj] = v;
	    	count++;
		}	
	} i=0 ; i=0 i 0 i<n i n i++ i++ i {
	    minj = i;
	    
	    for(j=i ; j<n ; j++){
		if(A[j] < A[minj]){
		    minj = j;
			}
	    }
	    if(A[i] != A[minj]){
	    	v = A[i];
	    	A[i] = A[minj];
	   		A[minj] = v;
	    	count++;
		}	
	} {
	    minj = i;
	    
	    for(j=i ; j<n ; j++){
		if(A[j] < A[minj]){
		    minj = j;
			}
	    }
	    if(A[i] != A[minj]){
	    	v = A[i];
	    	A[i] = A[minj];
	   		A[minj] = v;
	    	count++;
		}	
	} minj = i minj i for(j=i ; j<n ; j++){
		if(A[j] < A[minj]){
		    minj = j;
			}
	    } j=i ; j=i j i j<n j n j++ j++ j {
		if(A[j] < A[minj]){
		    minj = j;
			}
	    } {
		if(A[j] < A[minj]){
		    minj = j;
			}
	    } if(A[j] < A[minj]){
		    minj = j;
			} A[j] < A[minj] A[j] A j A[minj] A minj {
		    minj = j;
			} minj = j minj j if(A[i] != A[minj]){
	    	v = A[i];
	    	A[i] = A[minj];
	   		A[minj] = v;
	    	count++;
		} A[i] != A[minj] A[i] A i A[minj] A minj {
	    	v = A[i];
	    	A[i] = A[minj];
	   		A[minj] = v;
	    	count++;
		} v = A[i] v A[i] A i A[i] = A[minj] A[i] A i A[minj] A minj A[minj] = v A[minj] A minj v count++ count 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(A[i] + " ") System.out.print System.out System System.out A[i] + " " A[i] A i " " System.out.println(A[i]) System.out.println System.out System System.out A[i] A i System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.Scanner;

class Main{
    public static void main(String[] args){
	int i;
	int j;
	int minj;
	int v;
	int count = 0;
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int A[] = new int[n];

	//Initialize data
        for(i=0 ; i<n ; i++){
            int num = scan.nextInt();
            A[i] = num;
        }
	
	for(i=0 ; i<n ; i++){
	    minj = i;
	    
	    for(j=i ; j<n ; j++){
		if(A[j] < A[minj]){
		    minj = j;
			}
	    }
	    if(A[i] != A[minj]){
	    	v = A[i];
	    	A[i] = A[minj];
	   		A[minj] = v;
	    	count++;
		}	
	}

	for(i=0 ; i<n-1 ; i++){
	    System.out.print(A[i] + " ");
	}
	System.out.println(A[i]);
	System.out.println(count);
	
    }
}

