#include <stdio.h>

int main(){
int i,j,minj;
int N,A[100],n,swap=0;

  scanf("%d", &N);
  for(i=0;i<N;i++)
    {
    scanf("%d", &A[i]);
    }

  for(i=0;i<N;i++)
    {
     minj = i;
     for(j=i;j<N;j++)
       {
         if(A[j] < A[minj]) minj = j;
       }
         if(minj != i)
         {
              n = A[i];
              A[i] = A[minj];
              A[minj] = n;
              swap++;
         }
    }

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

