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