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