#include <bits/stdc++.h>
int selectionSort(int A[100], int N) {
  int minj, i, j, k, C;
  for (i = 0; i < N; i++) {
    minj = i;
    for (j = i; j < N; j++) {
      if (A[j] < A[minj]) {
        minj = j;
      }
      k = A[i];
      A[i] = A[minj];
      A[minj] = k;
      if (i != minj) {
        C++;
      }
    }
  }
  return C;
}
int main() {
  int A[100], N, i, j, k, c, C;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &A[i]);
  }
  selectionSort(A, N);
  c = C;
  for (i = 0; i < N; i++) {
    printf("%d ", A[i]);
  }
  printf("\n%d\n", c);
  return 0;
}
