#include <stdio.h>
#define MAX 100

typedef struct{
  int A[MAX];
  int chenge;
}data;


void SelectionSort(data *,int);
void swap(data *,int,int);

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

  for(i=0;i<n;i++)
    scanf("%d",&a.A[i]);

  SelectionSort(&a,n);

  for(i=1;i<n;i++)
    printf("%d ",a.A[i-1]);
  printf("%d\n",a.A[i-1]);

  printf("%d\n",a.chenge);

  return 0;
}

void SelectionSort(data *p,int n){

  int i,j;
  int mini;

  p->chenge = 0;

  for(i=0;i<n;i++){
    mini = i;
    for(j=i+1;j<n;j++){
      if(p->A[j] < p->A[mini]){
        mini = j;
      }   
    }
    swap(p,i,mini);
  }
}

void swap(data *s,int i,int mini){

  int tmp;

  tmp = s->A[i];
  s->A[i] = s->A[mini];
  s->A[mini] = tmp; 
  s->chenge++;   
}