#include <stdio.h>

int main(){
  int num;
  int a[100];
  int i, j, swap, read;
  int count = 0;
  int min_i, min;

  scanf("%d", &num);
  for(i = 0; i < num; i++) {
    scanf("%d", &read);
    a[i] = read;
  }
  if(num == 1) printf("%d", a[0]);
  else{
  for(i = 0; i < num-1; i++){
    min_i = i; min = a[i];
    for(j = i+1; j < num; j++) if(a[i] > a[j]) min_i = j;
    if(i != min_i){
      swap = a[i];
      a[i] = a[min_i];
      a[min_i] = swap;
      count++;
    }
    printf("%d ", a[i]);
  }
  }
  printf("\n%d\n", count);

  return 0;
}