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