#include<stdio.h>

int selectionSort(int a[],int n){

	int i,j,minj,switch=0,temp;

	for(i=0;i<n-1;i++){
		minj=i;
		for(j=i;j<n){
			if(a[j]<a[minj])
				minj=j;
		}
		temp=a[i];
		a[i]=a[minj];
		a[minj]=temp;
		switch++
	}
	return switch;
}

int main(){

	int a[100],n,i,switch;

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

	switch=selectionSort(a,n);

	for(i=0;i<n;i++){
		printf("%d",a[i])
		if(i<n)
			printf(" ");
	}
	printf("\n%d\n",switch);
	
	return 0;
}