#include <stdio.h>
int main(void){
  int i, j, cnt = 0, minj, k,temp;
  int numbers[100];
 
  scanf("%d", &k);
   
  for(i = 0;i < k;i++){
    scanf("%d", &numbers[i]);
  }
 
  for(i = 0; i < k; i++ ) {
    minj = i;
    for(j= i; j < k; j++) {
      if(numbers[j] < numbers[minj]) {
         minj = j;
         temp = numbers[i];
         numbers[i] = numbers[minj];
         numbers[minj] = minj;
         cnt++;
      }

    }
  }
  for(i=0; i<N; i++)
    {
      printf("%d", A[i]);
      if(i<N-1)
    {
      printf(" ");
    }
    }
  printf("\n");
  printf("%d\n", cnt);
 
  return 0;  
}
