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