import java.util.Scanner;

/**
 * Created by ??\??? on 2016/12/6.
 */
public class Main {
    static int si(String s){
        return Integer.parseInt(s);
    }

    static int run(String[] args){
        Scanner scan  = new Scanner(System.in);
        int T = si(scan.nextLine());
        int sum = 0;
        String[] lines = scan.nextLine().split(" ");
        for(int i = 0;i < lines.length;i++){
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        }
        for(int i = 0;i<lines.length;i++){
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        }
        System.out.println();
        System.out.println(sum);
        return 0;
    }
    public static void main(String[] args){
        run(args);
    }

} import java.util.Scanner; Scanner java.util public class Main {
    static int si(String s){
        return Integer.parseInt(s);
    }

    static int run(String[] args){
        Scanner scan  = new Scanner(System.in);
        int T = si(scan.nextLine());
        int sum = 0;
        String[] lines = scan.nextLine().split(" ");
        for(int i = 0;i < lines.length;i++){
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        }
        for(int i = 0;i<lines.length;i++){
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        }
        System.out.println();
        System.out.println(sum);
        return 0;
    }
    public static void main(String[] args){
        run(args);
    }

} Main static int si(String s){
        return Integer.parseInt(s);
    } si {
        return Integer.parseInt(s);
    } return Integer.parseInt(s); Integer.parseInt(s) Integer.parseInt Integer s String s s static int run(String[] args){
        Scanner scan  = new Scanner(System.in);
        int T = si(scan.nextLine());
        int sum = 0;
        String[] lines = scan.nextLine().split(" ");
        for(int i = 0;i < lines.length;i++){
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        }
        for(int i = 0;i<lines.length;i++){
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        }
        System.out.println();
        System.out.println(sum);
        return 0;
    } run {
        Scanner scan  = new Scanner(System.in);
        int T = si(scan.nextLine());
        int sum = 0;
        String[] lines = scan.nextLine().split(" ");
        for(int i = 0;i < lines.length;i++){
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        }
        for(int i = 0;i<lines.length;i++){
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        }
        System.out.println();
        System.out.println(sum);
        return 0;
    } Scanner scan  = new Scanner(System.in); scan new Scanner(System.in) int T = si(scan.nextLine()); T si(scan.nextLine()) si scan.nextLine() scan.nextLine scan int sum = 0; sum 0 String[] lines = scan.nextLine().split(" "); lines scan.nextLine().split(" ") scan.nextLine().split scan.nextLine() scan.nextLine scan " " for(int i = 0;i < lines.length;i++){
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        } int i = 0; int i = 0; i 0 i < lines.length i lines.length lines lines.length i++ i++ i {
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        } {
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        } int min = i; min i for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            } int j = i+1; int j = i+1; j i+1 i 1 j<lines.length j lines.length lines lines.length j++ j++ j {
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            } {
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            } if(si(lines[min])>si(lines[j])){
                    min = j;

                } si(lines[min])>si(lines[j]) si(lines[min]) si lines[min] lines min si(lines[j]) si lines[j] lines j {
                    min = j;

                } min = j min j if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            } min!=i min i {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            } String s = lines[i]; s lines[i] lines i lines[i] = lines[min] lines[i] lines i lines[min] lines min lines[min] = s lines[min] lines min s sum++ sum for(int i = 0;i<lines.length;i++){
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        } int i = 0; int i = 0; i 0 i<lines.length i lines.length lines lines.length i++ i++ i {
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        } {
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        } if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]); i==0 i 0 System.out.print(lines[0]) System.out.print System.out System System.out lines[0] lines 0 System.out.print(" "+lines[i]) System.out.print System.out System System.out " "+lines[i] " " lines[i] lines i System.out.println() System.out.println System.out System System.out System.out.println(sum) System.out.println System.out System System.out sum return 0; 0 String[] args args public static void main(String[] args){
        run(args);
    } main {
        run(args);
    } run(args) run args String[] args args public class Main {
    static int si(String s){
        return Integer.parseInt(s);
    }

    static int run(String[] args){
        Scanner scan  = new Scanner(System.in);
        int T = si(scan.nextLine());
        int sum = 0;
        String[] lines = scan.nextLine().split(" ");
        for(int i = 0;i < lines.length;i++){
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        }
        for(int i = 0;i<lines.length;i++){
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        }
        System.out.println();
        System.out.println(sum);
        return 0;
    }
    public static void main(String[] args){
        run(args);
    }

} public class Main {
    static int si(String s){
        return Integer.parseInt(s);
    }

    static int run(String[] args){
        Scanner scan  = new Scanner(System.in);
        int T = si(scan.nextLine());
        int sum = 0;
        String[] lines = scan.nextLine().split(" ");
        for(int i = 0;i < lines.length;i++){
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        }
        for(int i = 0;i<lines.length;i++){
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        }
        System.out.println();
        System.out.println(sum);
        return 0;
    }
    public static void main(String[] args){
        run(args);
    }

} Main
import java.util.Scanner;

/**
 * Created by ??\??? on 2016/12/6.
 */
public class Main {
    static int si(String s){
        return Integer.parseInt(s);
    }

    static int run(String[] args){
        Scanner scan  = new Scanner(System.in);
        int T = si(scan.nextLine());
        int sum = 0;
        String[] lines = scan.nextLine().split(" ");
        for(int i = 0;i < lines.length;i++){
            int min = i;
            for(int j = i+1;j<lines.length;j++){
                if(si(lines[min])>si(lines[j])){
                    min = j;

                }
            }
            if(min!=i) {
                String s = lines[i];
                lines[i] = lines[min];
                lines[min] = s;
                sum++;
            }
        }
        for(int i = 0;i<lines.length;i++){
            if(i==0)
                System.out.print(lines[0]);
            else
                System.out.print(" "+lines[i]);
        }
        System.out.println();
        System.out.println(sum);
        return 0;
    }
    public static void main(String[] args){
        run(args);
    }

}