#include<stdio.h>
void SelectionSort(int,int);
#define N 100 



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

}

void SelectionSort(int *a,int num){
  int i,j,minj,con=0;
  for(i=1;i<num;i++){
    minj = i;
    con++;
    for(j=0;j<num;j++) if(a[j]<a[minj]) minj = j;    

    a[i] = a[minj];
  }

  for(i=0;i<num-1;i++)
    printf("%d ",a[i]);
  printf("%d\n",a[num-1]);  
  printf("%d\n",con);
}