#include<stdio.h>

void selsort(int seq[],int x){
	int i,j,min,c,tmp;
	int len[x];
	c = 0;
	for(i=1;i<x;i++){
		min = i;
		for(j=i;j<x;j++){
			if(seq[j]<seq[min])
				min = j;
		}
		tmp = seq[i];
		seq[i] = seq[min];
		seq[min] = tmp;
		c++;
	}
	for(i=0;i<x;i++)
		printf("%d ",seq[i]);
	printf("\n");
	printf("%d",c);
}

int main(){
	int i,j,x;
	int seq[100];
	scanf("%d",&x);
	for(i=0;i<x;i++)
		scanf("%d",&seq[i]);
	selsort(seq,x);
	return 0;
}