#include <bits/stdc++.h>
int main(void) {
  int n, i, j, a[105], minj, k, c;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  k = 0;
  for (i = 0; i < n; i++) {
    minj = i;
    for (j = i; j < n; j++) {
      if (a[j] < a[minj]) minj = j;
    }
    k++;
    c = a[i];
    a[i] = a[minj];
    a[minj] = c;
  }
  for (i = 0; i < n - 1; i++) printf("%d ", a[i]);
  printf("%d\n", a[n - 1]);
  printf("%d\n", k);
  return 0;
}
