/**
 * ?????????:O(n^2)
 * ??±?????????????¨?????????´??\?????¢??????????????????????´?,?±????????¨???????????????????
 */
#include <stdio.h>

// ????????????,????????????????????¢????¬???°
int selectionSort(int A[], int N){
	int i, j, minj, sw = 0, tmp;
	for(i = 0; i < N-1; i++){
		minj = i;
		for(j = i+1; j < N; j++){ // ?????°????°????
			if(A[minj] > A[j]) minj = j;
		}
		tmp = A[minj]; A[minj] = A[i]; A[i] = tmp;
		if(i != minj) sw++;
	}
	return sw;
}

int main(){
	//freopen("in.txt", "r", stdin);
	int i,N,A[100],sw;
	while(~scanf("%d", &N)) {
	    for(i = 0; i < N; i++) scanf("%d", &A[i]);
           sw = selectionSort(A, N);
           for(i = 0; i < N; i++){
           	if(i > 0) printf(" ");
           	printf("%d", A[i]);
           }
           printf("\n");
           printf("%d\n", sw);
	}
	return 0;
}