#include <stdio.h>
#include <stdlib.h>
#define N 100

int SelectionSort(int,int *);

int main(){
  int a,*num,i;
  num = (int*)malloc(a*sizeof(int));
  scanf("%d",&a); 
  for(i = 0;i < a;i++){
    scanf("%d",&num[i]);
  }
  SelectionSort(a,num);
  free(num);
  return;
  }

int SelectionSort(int len,int *a){
  int i,j,min,tmp,cnt=0;

  for(i = 0;i < len;i++){
    min = i;
    for(j = i + 1;j < len;j++){
      if(a[j] < a[min]){
	min = j;
      }
    }


    if(min != i){
      tmp = a[i];
      a[i] = a[min];
      a[min] = tmp;
      cnt++;
    }
    printf("%d ",a[i]);
  }
  printf("\n");
  printf("%d\n",cnt);
  return 0;
}