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