#include <bits/stdc++.h>
int selectionSort(int a[], int n) {
  int i, minj, j, num = 0, g;
  for (i = 0; i < n; i++) {
    minj = i;
    for (j = i; i < n; j++)
      if (a[j] < a[minj]) minj = j;
    g = a[minj];
    a[minj] = a[j];
    a[j] = g;
    if (i != minj) num++;
  }
  return num;
}
int main() {
  int n, a[101], i, num = 0;
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    num = selectionSort(a, n);
    printf("%d", a[0]);
    for (i = 0; i < n; i++) printf(" %d", a[i]);
    printf("\n%d\n", num);
  }
  return 0;
}
