#include <stdio.h>
  
int main()
{
  int array[100], n, i, j, a, tmp,count;
  
   scanf("%d", &n);
  
   for ( i = 0 ; i < n ; i++ )
      scanf("%d", &array[i]);
  
   for ( i = 0 ; i <  n - 1  ; i++ ){
      a = i;
  
      for ( j = i + 1 ; j < n ; j++ ){
         if ( array[a] > array[j] )
            a = j;
      }
      if ( a != i )
      {
         tmp = array[i];
         array[i] = array[a];
         array[a] = tmp;
     count ++;
      }
   }
  
   
   for ( i = 0 ; i < n - 1 ; i++ ){
      printf("%d ", array[i]);
     }
   
   printf("%d\n",array[i]);
   printf("%d\n",count);
   return 0;
}