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