import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int size = 0, time = 0, minij, b = 0;
        size = sc.nextInt();
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = sc.nextInt();
        }
        for (int v = 0; v < size; v++) {
            minij = v;
            for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            }
            if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            }
        }

        for (int k = 0; k < size; k++) {
            System.out.print(a[k]);
            if (k != (size - 1)) System.out.print(" ");
        }
        System.out.print("\n");
        System.out.println(time);


    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int size = 0, time = 0, minij, b = 0;
        size = sc.nextInt();
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = sc.nextInt();
        }
        for (int v = 0; v < size; v++) {
            minij = v;
            for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            }
            if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            }
        }

        for (int k = 0; k < size; k++) {
            System.out.print(a[k]);
            if (k != (size - 1)) System.out.print(" ");
        }
        System.out.print("\n");
        System.out.println(time);


    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int size = 0, time = 0, minij, b = 0;
        size = sc.nextInt();
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = sc.nextInt();
        }
        for (int v = 0; v < size; v++) {
            minij = v;
            for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            }
            if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            }
        }

        for (int k = 0; k < size; k++) {
            System.out.print(a[k]);
            if (k != (size - 1)) System.out.print(" ");
        }
        System.out.print("\n");
        System.out.println(time);


    } main {
        Scanner sc = new Scanner(System.in);
        int size = 0, time = 0, minij, b = 0;
        size = sc.nextInt();
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = sc.nextInt();
        }
        for (int v = 0; v < size; v++) {
            minij = v;
            for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            }
            if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            }
        }

        for (int k = 0; k < size; k++) {
            System.out.print(a[k]);
            if (k != (size - 1)) System.out.print(" ");
        }
        System.out.print("\n");
        System.out.println(time);


    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int size = 0 size 0 time = 0 time 0 minij minij b = 0; b 0 size = sc.nextInt() size sc.nextInt() sc.nextInt sc int[] a = new int[size]; a new int[size] size for (int i = 0; i < size; i++) {
            a[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc for (int v = 0; v < size; v++) {
            minij = v;
            for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            }
            if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            }
        } int v = 0; int v = 0; v 0 v < size v size v++ v++ v {
            minij = v;
            for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            }
            if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            }
        } {
            minij = v;
            for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            }
            if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            }
        } minij = v minij v for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            } int w = v; int w = v; w v w < size w size w++ w++ w {
                if (a[w] < a[minij]) minij = w;
            } {
                if (a[w] < a[minij]) minij = w;
            } if (a[w] < a[minij]) minij = w; a[w] < a[minij] a[w] a w a[minij] a minij minij = w minij w if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            } v != minij v minij {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            } b = a[v] b a[v] a v a[v] = a[minij] a[v] a v a[minij] a minij a[minij] = b a[minij] a minij b time++ time for (int k = 0; k < size; k++) {
            System.out.print(a[k]);
            if (k != (size - 1)) System.out.print(" ");
        } int k = 0; int k = 0; k 0 k < size k size k++ k++ k {
            System.out.print(a[k]);
            if (k != (size - 1)) System.out.print(" ");
        } {
            System.out.print(a[k]);
            if (k != (size - 1)) System.out.print(" ");
        } System.out.print(a[k]) System.out.print System.out System System.out a[k] a k if (k != (size - 1)) System.out.print(" "); k != (size - 1) k (size - 1) size 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.print("\n") System.out.print System.out System System.out "\n" System.out.println(time) System.out.println System.out System System.out time String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int size = 0, time = 0, minij, b = 0;
        size = sc.nextInt();
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = sc.nextInt();
        }
        for (int v = 0; v < size; v++) {
            minij = v;
            for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            }
            if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            }
        }

        for (int k = 0; k < size; k++) {
            System.out.print(a[k]);
            if (k != (size - 1)) System.out.print(" ");
        }
        System.out.print("\n");
        System.out.println(time);


    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int size = 0, time = 0, minij, b = 0;
        size = sc.nextInt();
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = sc.nextInt();
        }
        for (int v = 0; v < size; v++) {
            minij = v;
            for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            }
            if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            }
        }

        for (int k = 0; k < size; k++) {
            System.out.print(a[k]);
            if (k != (size - 1)) System.out.print(" ");
        }
        System.out.print("\n");
        System.out.println(time);


    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int size = 0, time = 0, minij, b = 0;
        size = sc.nextInt();
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = sc.nextInt();
        }
        for (int v = 0; v < size; v++) {
            minij = v;
            for (int w = v; w < size; w++) {
                if (a[w] < a[minij]) minij = w;
            }
            if (v != minij) {
                b = a[v];
                a[v] = a[minij];
                a[minij] = b;
                time++;
            }
        }

        for (int k = 0; k < size; k++) {
            System.out.print(a[k]);
            if (k != (size - 1)) System.out.print(" ");
        }
        System.out.print("\n");
        System.out.println(time);


    }
}

