import java.util.Scanner;

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

        int count = 0;
        int N = sc.nextInt();
        int[] x;
        x = new int[100];

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

        for (int i = 0; i < N; i++) {
            int minj = i;
            for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            }

                if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                }
        }

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

        int count = 0;
        int N = sc.nextInt();
        int[] x;
        x = new int[100];

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

        for (int i = 0; i < N; i++) {
            int minj = i;
            for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            }

                if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                }
        }

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

        int count = 0;
        int N = sc.nextInt();
        int[] x;
        x = new int[100];

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

        for (int i = 0; i < N; i++) {
            int minj = i;
            for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            }

                if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                }
        }

            for (int i = 0; i < N - 1; i++) {
                System.out.print(x[i] + " ");
            }
            System.out.println(x[N - 1]);
            System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);

        int count = 0;
        int N = sc.nextInt();
        int[] x;
        x = new int[100];

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

        for (int i = 0; i < N; i++) {
            int minj = i;
            for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            }

                if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                }
        }

            for (int i = 0; i < N - 1; i++) {
                System.out.print(x[i] + " ");
            }
            System.out.println(x[N - 1]);
            System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count = 0; count 0 int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] x; x x = new int[100] x new int[100] 100 for (int i = 0; i < N; i++) {
            x[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            x[i] = sc.nextInt();
        } {
            x[i] = sc.nextInt();
        } x[i] = sc.nextInt() x[i] x i sc.nextInt() sc.nextInt sc for (int i = 0; i < N; i++) {
            int minj = i;
            for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            }

                if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            int minj = i;
            for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            }

                if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                }
        } {
            int minj = i;
            for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            }

                if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                }
        } int minj = i; minj i for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            } int j = i+1; int j = i+1; j i+1 i 1 j < N j N j++ j++ j {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            } {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            } if (x[minj] > x[j]) {
                    minj = j;
                } x[minj] > x[j] x[minj] x minj x[j] x j {
                    minj = j;
                } minj = j minj j if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                } minj != i minj i {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                } int temp = x[i]; temp x[i] x i x[i] = x[minj] x[i] x i x[minj] x minj x[minj] = temp x[minj] x minj temp count++ count for (int i = 0; i < N - 1; i++) {
                System.out.print(x[i] + " ");
            } int i = 0; int i = 0; i 0 i < N - 1 i N - 1 N 1 i++ i++ i {
                System.out.print(x[i] + " ");
            } {
                System.out.print(x[i] + " ");
            } System.out.print(x[i] + " ") System.out.print System.out System System.out x[i] + " " x[i] x i " " System.out.println(x[N - 1]) System.out.println System.out System System.out x[N - 1] x N - 1 N 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) {
        Scanner sc = new Scanner(System.in);

        int count = 0;
        int N = sc.nextInt();
        int[] x;
        x = new int[100];

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

        for (int i = 0; i < N; i++) {
            int minj = i;
            for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            }

                if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                }
        }

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

        int count = 0;
        int N = sc.nextInt();
        int[] x;
        x = new int[100];

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

        for (int i = 0; i < N; i++) {
            int minj = i;
            for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            }

                if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                }
        }

            for (int i = 0; i < N - 1; i++) {
                System.out.print(x[i] + " ");
            }
            System.out.println(x[N - 1]);
            System.out.println(count);
    }
} Main
import java.util.Scanner;

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

        int count = 0;
        int N = sc.nextInt();
        int[] x;
        x = new int[100];

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

        for (int i = 0; i < N; i++) {
            int minj = i;
            for (int j = i+1; j < N; j++) {
                if (x[minj] > x[j]) {
                    minj = j;
                }
            }

                if (minj != i) {
                    int temp = x[i];
                    x[i] = x[minj];
                    x[minj] = temp;
                    count++;
                }
        }

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