#include <bits/stdc++.h>
int selectionSort(int *A, int n) {
  int c, i, j, min;
  c = 0;
  for (i = 0; i < n - 1; i++) {
    min = i;
    for (j = i; j < n; j++) {
      if (A[j] < A[min]) {
        min = j;
      }
    }
    if (i != min) {
      do {
        int t = A[i];
        A[i] = A[min];
        A[min] = t;
      } while (0);
      c++;
    }
  }
  return c;
}
int main() {
  int c, i, n;
  int A[100];
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &A[i]);
  c = selectionSort(A, n);
  for (i = 0; i < n; i++) printf("%d ", A[i]);
  printf("\n");
  printf("%d\n", c);
  return 0;
}
