import java.io.*;
import java.util.*;
  
public class Main {
    public static void main(String[] args) throws Exception {
        int count = 0;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
          
        int[] array = new int[n];
            for(int i = 0; i<n; i++){
                array[i] = sc.nextInt();
            }
        for(int i=0; i<array.length-1; i++){
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        }
        for(int k=0; k<array.length-1; k++){
            int number = array[k];
            System.out.print(number + " ");
        }
        System.out.println(array[array.length-1]);
        System.out.println(count);
          
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        int count = 0;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
          
        int[] array = new int[n];
            for(int i = 0; i<n; i++){
                array[i] = sc.nextInt();
            }
        for(int i=0; i<array.length-1; i++){
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        }
        for(int k=0; k<array.length-1; k++){
            int number = array[k];
            System.out.print(number + " ");
        }
        System.out.println(array[array.length-1]);
        System.out.println(count);
          
    }
} Main public static void main(String[] args) throws Exception {
        int count = 0;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
          
        int[] array = new int[n];
            for(int i = 0; i<n; i++){
                array[i] = sc.nextInt();
            }
        for(int i=0; i<array.length-1; i++){
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        }
        for(int k=0; k<array.length-1; k++){
            int number = array[k];
            System.out.print(number + " ");
        }
        System.out.println(array[array.length-1]);
        System.out.println(count);
          
    } main {
        int count = 0;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
          
        int[] array = new int[n];
            for(int i = 0; i<n; i++){
                array[i] = sc.nextInt();
            }
        for(int i=0; i<array.length-1; i++){
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        }
        for(int k=0; k<array.length-1; k++){
            int number = array[k];
            System.out.print(number + " ");
        }
        System.out.println(array[array.length-1]);
        System.out.println(count);
          
    } int count = 0; count 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] array = new int[n]; array new int[n] n for(int i = 0; i<n; i++){
                array[i] = sc.nextInt();
            } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
                array[i] = sc.nextInt();
            } {
                array[i] = sc.nextInt();
            } array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc for(int i=0; i<array.length-1; i++){
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        } int i=0; int i=0; i 0 i<array.length-1 i array.length-1 array.length array array.length 1 i++ i++ i {
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        } {
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        } int min =i; min i for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            } int j = i+1; int j = i+1; j i+1 i 1 j<array.length j array.length array array.length j++ j++ j {
                if(array[j] < array[min]){
                    min = j;
                }
            } {
                if(array[j] < array[min]){
                    min = j;
                }
            } if(array[j] < array[min]){
                    min = j;
                } array[j] < array[min] array[j] array j array[min] array min {
                    min = j;
                } min = j min j if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
} i != min i min {
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
} int tmp = array[i]; tmp array[i] array i array[i] = array[min] array[i] array i array[min] array min array[min] = tmp array[min] array min tmp count += 1 count 1 for(int k=0; k<array.length-1; k++){
            int number = array[k];
            System.out.print(number + " ");
        } int k=0; int k=0; k 0 k<array.length-1 k array.length-1 array.length array array.length 1 k++ k++ k {
            int number = array[k];
            System.out.print(number + " ");
        } {
            int number = array[k];
            System.out.print(number + " ");
        } int number = array[k]; number array[k] array k System.out.print(number + " ") System.out.print System.out System System.out number + " " number " " System.out.println(array[array.length-1]) System.out.println System.out System System.out array[array.length-1] array array.length-1 array.length array array.length 1 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        int count = 0;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
          
        int[] array = new int[n];
            for(int i = 0; i<n; i++){
                array[i] = sc.nextInt();
            }
        for(int i=0; i<array.length-1; i++){
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        }
        for(int k=0; k<array.length-1; k++){
            int number = array[k];
            System.out.print(number + " ");
        }
        System.out.println(array[array.length-1]);
        System.out.println(count);
          
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        int count = 0;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
          
        int[] array = new int[n];
            for(int i = 0; i<n; i++){
                array[i] = sc.nextInt();
            }
        for(int i=0; i<array.length-1; i++){
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        }
        for(int k=0; k<array.length-1; k++){
            int number = array[k];
            System.out.print(number + " ");
        }
        System.out.println(array[array.length-1]);
        System.out.println(count);
          
    }
} Main
import java.io.*;
import java.util.*;
  
public class Main {
    public static void main(String[] args) throws Exception {
        int count = 0;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
          
        int[] array = new int[n];
            for(int i = 0; i<n; i++){
                array[i] = sc.nextInt();
            }
        for(int i=0; i<array.length-1; i++){
            int min =i;
            for(int j = i+1; j<array.length; j++){
                if(array[j] < array[min]){
                    min = j;
                }
            }
             if(i != min){
                int tmp = array[i];
                array[i] = array[min];
                array[min] = tmp;
                count += 1;
}
        }
        for(int k=0; k<array.length-1; k++){
            int number = array[k];
            System.out.print(number + " ");
        }
        System.out.println(array[array.length-1]);
        System.out.println(count);
          
    }
}