#include<iostream>

using namespace std;

int selectionSort(int A[],int N){
	for(int i=0; i<N; i++){
		int minj = i,j,count;
		for(j=1; j<N; j++){
			if(A[j]<A[minj]){
				minj=j;
			}
		}
		swap(A[j],A[minj]);
		count++;
	}
	return count;
}
int main(){
	int N,A[100],count;
	cin >> N;
	for(int i=0; i<N; i++) cin >> A[i];
	count = selectionSort(A,N);
	for(int i=0; i<N; i++){
		if(i==N-1)cout << A[i];
		else cout << A[i] << " ";
	}
	cout << endl << count << endl;	
}
