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);
    }

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz