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