//
//  main.c
//  ???????????????
//
//  Created by ??¶?????? on 2016/11/22.
//  Copyright ?? 2016??´ ??¶??????. All rights reserved.
//

#include <stdio.h>

int selectionSort(int *a, int n){
    int i, j, minj, v, cnt;
    for(i = 0;i < n;i++){
        minj = i;
        for(j = i;j < n;j++){
            if(a[j] < a[minj]){
                minj = j;
            }
        }
        v = a[i];
        a[i] = a[minj];
        a[minj] = v;
        if(i != minj){
            cnt++;
        }
    }
    return cnt;
}

int main(int argc, const char * argv[]) {
    int N = 100, n, i;
    int a[N], cnt;
    scanf("%d", &n);
    for(i = 0;i < n;i++){
        scanf("%d", &a[i]);
    }
    cnt = selectionSort(a, n);
    for(i = 0;i < n;i++){
        printf("%d", a[i]);
        if(i < n-1){
            printf(" ");
        }
    }
    printf("\n");
    printf("%d\n", cnt);
    
    
    return 0;
}