#include <stdio.h>

int selectionSort(int A[100], int N) {
     
     int A[100], N, minj, i, j, k, C;
     for (i = 0; i < N; i++){
          minj = i;
          for (j = i; j < N; j++){
                 if(A[j] < A[minj]){
                       minj = j;
                 }
          k = A[i];
          A[i] = A[minj];
          A[minj] = k;
          if (i != minj){
               C++;
          }
        }
     }

     return C;

}

int main () {

     int A[100], N, i, j, k, c;
     scanf("%d", &N);
     for (i = 0; i < n; i++){
          scanf("%d", &A[i]);
     }

     selectionSort(A, N);

     c = C;

     for (i = 0; i < n; i++){
           printf("%d ", A[i]);
     }

     printf("\n%d\n", c);

     return 0;

}