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