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