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