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