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