import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];

        int minj = 0;
        int changeBox = 0;
        int count = 0;

//      N????????´??°?????????A???????´?
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }

        for(int i = 0; i < n; i++){
            minj = i;

            for(int j = i; j < n; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            }
        }
        System.out.println();
        System.out.println(count);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];

        int minj = 0;
        int changeBox = 0;
        int count = 0;

//      N????????´??°?????????A???????´?
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }

        for(int i = 0; i < n; i++){
            minj = i;

            for(int j = i; j < n; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            }
        }
        System.out.println();
        System.out.println(count);
    }
} Main public static void main(String[] args) throws NumberFormatException, IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];

        int minj = 0;
        int changeBox = 0;
        int count = 0;

//      N????????´??°?????????A???????´?
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }

        for(int i = 0; i < n; i++){
            minj = i;

            for(int j = i; j < n; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            }
        }
        System.out.println();
        System.out.println(count);
    } main {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];

        int minj = 0;
        int changeBox = 0;
        int count = 0;

//      N????????´??°?????????A???????´?
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }

        for(int i = 0; i < n; i++){
            minj = i;

            for(int j = i; j < n; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            }
        }
        System.out.println();
        System.out.println(count);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] A = new int[n]; A new int[n] n int minj = 0; minj 0 int changeBox = 0; changeBox 0 int count = 0; count 0 for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            A[i] = Integer.parseInt(input[i]);
        } {
            A[i] = Integer.parseInt(input[i]);
        } A[i] = Integer.parseInt(input[i]) A[i] A i Integer.parseInt(input[i]) Integer.parseInt Integer input[i] input i for(int i = 0; i < n; i++){
            minj = i;

            for(int j = i; j < n; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            minj = i;

            for(int j = i; j < n; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            }
        } {
            minj = i;

            for(int j = i; j < n; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            }
        } 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){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            } i != minj i minj {
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            } changeBox = A[i] changeBox A[i] A i A[i] = A[minj] A[i] A i A[minj] A minj A[minj] = changeBox A[minj] A minj changeBox count++ count for(int i = 0; i < n; i++){
            if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            }
        } {
            if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            }
        } if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            } i == 0 i 0 {
                System.out.print(A[i]);
            } System.out.print(A[i]) System.out.print System.out System System.out A[i] 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() System.out.println System.out System System.out 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 NumberFormatException, IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];

        int minj = 0;
        int changeBox = 0;
        int count = 0;

//      N????????´??°?????????A???????´?
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }

        for(int i = 0; i < n; i++){
            minj = i;

            for(int j = i; j < n; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            }
        }
        System.out.println();
        System.out.println(count);
    }
} public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];

        int minj = 0;
        int changeBox = 0;
        int count = 0;

//      N????????´??°?????????A???????´?
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }

        for(int i = 0; i < n; i++){
            minj = i;

            for(int j = i; j < n; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            }
        }
        System.out.println();
        System.out.println(count);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws NumberFormatException, IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        int[] A = new int[n];

        int minj = 0;
        int changeBox = 0;
        int count = 0;

//      N????????´??°?????????A???????´?
        for(int i = 0; i < n; i++){
            A[i] = Integer.parseInt(input[i]);
        }

        for(int i = 0; i < n; i++){
            minj = i;

            for(int j = i; j < n; j++){
                if(A[j] < A[minj]){
                    minj = j;
                }
            }
            if(i != minj){
                changeBox = A[i];
                A[i] = A[minj];
                A[minj] = changeBox;
                count++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i == 0){
                System.out.print(A[i]);
            }else{
                System.out.print(" " + A[i]);
            }
        }
        System.out.println();
        System.out.println(count);
    }
}