#include <bits/stdc++.h>
uint32_t selection_sort(int32_t buf[], size_t size) {
  uint32_t count = 0;
  uint32_t i;
  for (i = 0; i < size; i++) {
    uint32_t min_idx = i;
    uint32_t j;
    for (j = i + 1; j < size; j++) {
      if (buf[j] < buf[min_idx]) {
        min_idx = j;
      }
    }
    if (i != min_idx) {
      do {
        typeof(buf[i]) _a = buf[i];
        buf[i] = buf[min_idx];
        buf[min_idx] = _a;
      } while (0);
      count++;
    }
  }
  return count;
}
int32_t main(void) {
  int32_t num;
  scanf("%d", &num);
  int32_t buf[256];
  uint32_t i;
  for (i = 0; i < num; i++) {
    scanf("%d", &buf[i]);
  }
  uint32_t count = selection_sort(buf, num);
  do {
    uint16_t i;
    for (i = 0; i < num; i++) {
      if (i != 0) printf(" ");
      printf("%d", buf[i]);
    }
    printf("\n");
  } while (0);
  printf("%d", count);
  return 0;
}
