#include <stdio.h>

int selectionsort(int A[],int N)
{
	int i,j,t,minj;
	int count = 0;
	
	for(i = 0; i < N - 1; i++)
	{
		minj = i;
		for(j = 0; j = N - 1; j++)
		{
			if(A[j] < A[minj])
			{
				minj = j;
			}
		}
		
		t = 0;
		t = A[minj];
		A[minj] = A[i];
		A[i] = t;
		count++;
	}
	
int main()
{
	int A[100],N,count;
	int i.j;
	
	scanf("%d",&N);
	
	for(i = 0; i < N - 1; i++)
	{
		scanf("%d",A + i);
	}
	
	count = selectionsort(A,N);
	
	for(i = 0; i < N - 1; i++)
	{
		if(i)
		{
			printf(" ");
		}
		
		printf("%d",A[i]);
	}
	printf("\n");
	
	printf("%d\n",count);
	
	return 0;
}
	