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