#include <bits/stdc++.h>
int main() {
  int n, i, j, minj;
  int flag = 0, array[100];
  int temp, count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &array[i]);
  for (i = 0; i < n; i++) {
    minj = i;
    for (j = i; j < n; j++) {
      if (array[minj] > array[j]) {
        minj = j;
        flag = 1;
      }
    }
    if (flag == 1) {
      count++;
      flag = 0;
    }
    temp = array[i];
    array[i] = array[minj];
    array[minj] = temp;
  }
  for (i = 0; i < n; i++) printf("%d ", array[i]);
  printf("\n");
  printf("%d\n", count);
  return 0;
}
