import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] a = new int[n];

        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }

        int swapCount = 0;
        for (int i = 0; i < n; i++) {
            int minj = i;
            for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            }
            if (i != minj) {
                swap(a, i, minj);
                swapCount++;
            }
        }
        printlnArray(a);
        System.out.println(swapCount);
    }

    static void swap(int[] a, int i, int j) {
        int temp = a[i];
        a[i] = a[j];
        a[j] = temp;
    }

    private static void printlnArray(int[] a) {
        for (int i = 0; i < a.length - 1; i++) {
            System.out.print(a[i] + " ");
        }
        System.out.println(a[a.length - 1]);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] a = new int[n];

        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }

        int swapCount = 0;
        for (int i = 0; i < n; i++) {
            int minj = i;
            for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            }
            if (i != minj) {
                swap(a, i, minj);
                swapCount++;
            }
        }
        printlnArray(a);
        System.out.println(swapCount);
    }

    static void swap(int[] a, int i, int j) {
        int temp = a[i];
        a[i] = a[j];
        a[j] = temp;
    }

    private static void printlnArray(int[] a) {
        for (int i = 0; i < a.length - 1; i++) {
            System.out.print(a[i] + " ");
        }
        System.out.println(a[a.length - 1]);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] a = new int[n];

        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }

        int swapCount = 0;
        for (int i = 0; i < n; i++) {
            int minj = i;
            for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            }
            if (i != minj) {
                swap(a, i, minj);
                swapCount++;
            }
        }
        printlnArray(a);
        System.out.println(swapCount);
    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] a = new int[n];

        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }

        int swapCount = 0;
        for (int i = 0; i < n; i++) {
            int minj = i;
            for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            }
            if (i != minj) {
                swap(a, i, minj);
                swapCount++;
            }
        }
        printlnArray(a);
        System.out.println(swapCount);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int swapCount = 0; swapCount 0 for (int i = 0; i < n; i++) {
            int minj = i;
            for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            }
            if (i != minj) {
                swap(a, i, minj);
                swapCount++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int minj = i;
            for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            }
            if (i != minj) {
                swap(a, i, minj);
                swapCount++;
            }
        } {
            int minj = i;
            for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            }
            if (i != minj) {
                swap(a, i, minj);
                swapCount++;
            }
        } int minj = i; minj i for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            } int j = i; int 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 (i != minj) {
                swap(a, i, minj);
                swapCount++;
            } i != minj i minj {
                swap(a, i, minj);
                swapCount++;
            } swap(a, i, minj) swap a i minj swapCount++ swapCount printlnArray(a) printlnArray a System.out.println(swapCount) System.out.println System.out System System.out swapCount String[] args args static void swap(int[] a, int i, int j) {
        int temp = a[i];
        a[i] = a[j];
        a[j] = temp;
    } swap {
        int temp = a[i];
        a[i] = a[j];
        a[j] = temp;
    } int temp = a[i]; temp a[i] a i a[i] = a[j] a[i] a i a[j] a j a[j] = temp a[j] a j temp int[] a a int i i int j j private static void printlnArray(int[] a) {
        for (int i = 0; i < a.length - 1; i++) {
            System.out.print(a[i] + " ");
        }
        System.out.println(a[a.length - 1]);
    } printlnArray {
        for (int i = 0; i < a.length - 1; i++) {
            System.out.print(a[i] + " ");
        }
        System.out.println(a[a.length - 1]);
    } for (int i = 0; i < a.length - 1; i++) {
            System.out.print(a[i] + " ");
        } int i = 0; int i = 0; i 0 i < a.length - 1 i a.length - 1 a.length a a.length 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[a.length - 1]) System.out.println System.out System System.out a[a.length - 1] a a.length - 1 a.length a a.length 1 int[] a a public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] a = new int[n];

        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }

        int swapCount = 0;
        for (int i = 0; i < n; i++) {
            int minj = i;
            for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            }
            if (i != minj) {
                swap(a, i, minj);
                swapCount++;
            }
        }
        printlnArray(a);
        System.out.println(swapCount);
    }

    static void swap(int[] a, int i, int j) {
        int temp = a[i];
        a[i] = a[j];
        a[j] = temp;
    }

    private static void printlnArray(int[] a) {
        for (int i = 0; i < a.length - 1; i++) {
            System.out.print(a[i] + " ");
        }
        System.out.println(a[a.length - 1]);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] a = new int[n];

        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }

        int swapCount = 0;
        for (int i = 0; i < n; i++) {
            int minj = i;
            for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            }
            if (i != minj) {
                swap(a, i, minj);
                swapCount++;
            }
        }
        printlnArray(a);
        System.out.println(swapCount);
    }

    static void swap(int[] a, int i, int j) {
        int temp = a[i];
        a[i] = a[j];
        a[j] = temp;
    }

    private static void printlnArray(int[] a) {
        for (int i = 0; i < a.length - 1; i++) {
            System.out.print(a[i] + " ");
        }
        System.out.println(a[a.length - 1]);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] a = new int[n];

        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }

        int swapCount = 0;
        for (int i = 0; i < n; i++) {
            int minj = i;
            for (int j = i; j < n; j++) {
                if (a[j] < a[minj]) {
                    minj = j;
                }
            }
            if (i != minj) {
                swap(a, i, minj);
                swapCount++;
            }
        }
        printlnArray(a);
        System.out.println(swapCount);
    }

    static void swap(int[] a, int i, int j) {
        int temp = a[i];
        a[i] = a[j];
        a[j] = temp;
    }

    private static void printlnArray(int[] a) {
        for (int i = 0; i < a.length - 1; i++) {
            System.out.print(a[i] + " ");
        }
        System.out.println(a[a.length - 1]);
    }
}
