#include<stdio.h>

//selectionSort
int selectionSort(int A[], int N){
    int i, j, t, swap=0, minj;
    for(i=0;i<N;i++){
        minj = i;
        for(j=i;j<N-1;j++){
            if(A[j] < A[minj]) minj=j;
        }
        t =A[i]; A[i] = A[minj]; A[minj] = t;
        if(i != minj) swap++;
    }
return swap;
}

int main(){
    int A[100], N, i, swap;

    scanf("%d",&N);
    for(i=0;i<N;i++) scanf("%d",&A[i]);

    swap = selectionSort(A,N);

    for(i=0;i<N;i++){
        if(i>0) printf(" ");
        printf("%d",A[i]);
    }
    printf("\n");
    printf("%d",swap);

    return 0;
}
