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