#include <stdio.h>
int trump[101]={};
int n;

int main(void)
{
    scanf("%d",&n);
    int i,j;

    for(i=0;i<n;i++)
    {
        scanf("%d",&trump[i]);
    }
    int count=0
    for(i=0;i<n;i++)
    {
        int minj=i;
        for(j=0;j<n;j++)
        {
            if(trump[j]<trump[minj])
            {
                count++;
                minj=j;
            }
        }
        int c=trump[j];
        trump[j]=trump[minj];
        trump[minj]=c;
    }
    for(i=0;i<n;i++)
    {
        printf("%d",trump[i]);
        if(i<n-1)printf(" ");
    }
    printf("\n%d\n",count);


    return 0;
}