#include <stdio.h>
#include "stdafx.h"
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>

int main()
{
	int n,wk,i,flg,j;
	int minj;
	int data[102];
	int chg_cnt;
	char buff[8192];
	char *ptr,*wk_p;

	gets_s(buff,sizeof(buff));
	sscanf_s(buff,"%d",&n);
	gets_s(buff,sizeof(buff));
	
	ptr = strtok_s(buff," ",&wk_p);
	for (i=0 ; i<n ; i++) {
		sscanf_s(ptr,"%d",&(data[i]));
		ptr = strtok_s(NULL," ",&wk_p);
	}

	for (chg_cnt=0,i=0 ; i<n ; i++) {
		minj=i;
		for (flg=0,j=i+1 ; j<n ; j++) {
			if (data[j] < data[minj]) {
				minj = j;
				flg++;
			}
		}
		if (flg != 0) {
			chg_cnt++;
			wk = data[minj];
			data[minj] = data[i];
			data[i]=wk;
		}
	}

	for (i=0 ; i<n ; i++) {
		if (i == n-1) {
			printf("%d",data[i]);
		}
		else {
			printf("%d ",data[i]);
		}
	}
	printf("\n");
	printf("%d\n",chg_cnt);
	return 0;
}