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