import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        int[] a,b;
        a = new int[101];
        b = new int[101];
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int i,j,t,now=111,co=0,nowt=-1;
        for(i=0;i<n;i++)a[i] = s.nextInt();
        for(i=0;i<n;i++){
            for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            }
            if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            }
            now=111;
        }
        for(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(co);


    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        int[] a,b;
        a = new int[101];
        b = new int[101];
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int i,j,t,now=111,co=0,nowt=-1;
        for(i=0;i<n;i++)a[i] = s.nextInt();
        for(i=0;i<n;i++){
            for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            }
            if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            }
            now=111;
        }
        for(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(co);


    }
} Main public static void main(String[] args){
        int[] a,b;
        a = new int[101];
        b = new int[101];
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int i,j,t,now=111,co=0,nowt=-1;
        for(i=0;i<n;i++)a[i] = s.nextInt();
        for(i=0;i<n;i++){
            for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            }
            if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            }
            now=111;
        }
        for(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(co);


    } main {
        int[] a,b;
        a = new int[101];
        b = new int[101];
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int i,j,t,now=111,co=0,nowt=-1;
        for(i=0;i<n;i++)a[i] = s.nextInt();
        for(i=0;i<n;i++){
            for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            }
            if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            }
            now=111;
        }
        for(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(co);


    } int[] a a b; b a = new int[101] a new int[101] 101 b = new int[101] b new int[101] 101 Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int i i j j t t now=111 now 111 co=0 co 0 nowt=-1; nowt -1 1 for(i=0;i<n;i++)a[i] = s.nextInt(); i=0; i=0 i 0 i<n i n i++ i++ i a[i] = s.nextInt(); a[i] = s.nextInt() a[i] a i s.nextInt() s.nextInt s for(i=0;i<n;i++){
            for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            }
            if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            }
            now=111;
        } i=0; i=0 i 0 i<n i n i++ i++ i {
            for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            }
            if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            }
            now=111;
        } {
            for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            }
            if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            }
            now=111;
        } for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            } j=i; j=i j i j<n j n j++ j++ j {
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            } {
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            } if(now>a[j]){
                    now=a[j];
                    nowt = j;
                } now>a[j] now a[j] a j {
                    now=a[j];
                    nowt = j;
                } now=a[j] now a[j] a j nowt = j nowt j if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            } a[i]!=now&&nowt>=0 a[i]!=now a[i] a i now nowt>=0 nowt 0 {
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            } t = a[nowt] t a[nowt] a nowt a[nowt] = a[i] a[nowt] a nowt a[i] a i a[i]=t a[i] a i t co++ co now=111 now 111 for(i=0;i<n;i++){
            if(i==0)System.out.print(a[i]);
            else System.out.print(" "+a[i]);
        } i=0; 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 System.out System System.out a[i] 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(co) System.out.println System.out System System.out co String[] args args public class Main{
    public static void main(String[] args){
        int[] a,b;
        a = new int[101];
        b = new int[101];
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int i,j,t,now=111,co=0,nowt=-1;
        for(i=0;i<n;i++)a[i] = s.nextInt();
        for(i=0;i<n;i++){
            for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            }
            if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            }
            now=111;
        }
        for(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(co);


    }
} public class Main{
    public static void main(String[] args){
        int[] a,b;
        a = new int[101];
        b = new int[101];
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int i,j,t,now=111,co=0,nowt=-1;
        for(i=0;i<n;i++)a[i] = s.nextInt();
        for(i=0;i<n;i++){
            for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            }
            if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            }
            now=111;
        }
        for(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(co);


    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        int[] a,b;
        a = new int[101];
        b = new int[101];
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int i,j,t,now=111,co=0,nowt=-1;
        for(i=0;i<n;i++)a[i] = s.nextInt();
        for(i=0;i<n;i++){
            for(j=i;j<n;j++){
                if(now>a[j]){
                    now=a[j];
                    nowt = j;
                }
            }
            if(a[i]!=now&&nowt>=0){
                t = a[nowt];
                a[nowt] = a[i];
                a[i]=t;
                co++;
            }
            now=111;
        }
        for(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(co);


    }
}
