#include<stdio.h>

int main()
{
  int A[100], N, i, sw;

  scanf("%d",&N);
  for(i = 0 ; i < N ; i++) scanf("%d",&A[i]);
  
  sw = selectionSort(A,N);

  for(i = 0 ; i < N ; i++) printf("%d ",A[i]);

  printf("\n");
  printf("%d\n",sw);

  return 0;
}

int selectionSort(int A[], int N)
{
  int i, j, sw = 0, minj;

  for(i = 0 ; i < N - 1 ; i++)
    {
      minj = i;
      
      for(j = i ; j < N ; j++)
	{
	  if(A[j] < A[minj]) minj = j;
	}

      swap(A[j],A[minj]);

      if(i != minj) sw++;
    }
  return sw;
}

void swap(int x, int y)
{
  int temp;

    temp = x;
    x = y;
    y = temp;
}