#include <stdio.h>
int N;
int count=0;


void Process(int A[ ], int n){
	int i;
	for(i=0;i<n-1;i++)
		printf("%d ",A[i]);
	printf("%d\n",A[i]);
}


void SelectionSort(int A[ ], int n){
	int i,j,minj,temp;
		for(i = 0; i < N-1; i++){
			minj=i;
			for(j = i+1; j < N; j++){
			if(A[j] < A[minj])	minj = j;
	}
	temp = A[i];
		A[i] = A[minj];
		A[minj] = temp;
        count++;
	}
}


int main(void){
	int i;
	scanf("%d",&N);
	int A[100];
	for(i=0;i<N;i++)
		scanf("%d",&A[i]);
	
	SelectionSort(A, N);
	Process(A, N);

	printf("%d\n",count);
	
	return 0;
}